1- #! /bin/bash
1+ #! /bin/sh
22
33# Source colors script
44. zz_colors
1212)
1313
1414if [ -z " $feature " ]; then
15- echo -e " Usage: configure-feature <feature>\r "
15+ echo " Usage: configure-feature <feature>${End} "
1616 exit 1
1717fi
1818
@@ -22,16 +22,16 @@ export source=${source:-/usr/local/share/$feature}
2222# Get the indent size from devcontainer.json with jq, default to 2 if not found
2323export tabSize=4
2424
25- echo -e " Configuring feature <${Purple} $feature ${None} >\r "
26- echo -e " from <$source >\r "
25+ echo " Configuring feature <${Purple} $feature ${None} >${End} "
26+ echo " from <$source >${End} "
2727
2828# Go to the module root
2929cd " $( git rev-parse --show-toplevel) " > /dev/null
3030
3131# Deploy stubs if existing
3232if [ -d $source /stubs ]; then
3333
34- echo -e " ${Blue} Deploy stubs${End} "
34+ echo " ${Blue} Deploy stubs${End} "
3535
3636 find $source /stubs -type f -name " .*" -o -type f | while read file; do
3737
@@ -50,7 +50,7 @@ if [ -d $source/stubs ]; then
5050 # Remove # occurrences in the file path
5151 dest=$( echo $dest | sed ' s/\/\#/\//g' )
5252
53- echo -e " Add '$dest ' to .gitignore\r "
53+ echo " Add '$dest ' to .gitignore${End} "
5454
5555 # Add to .gitignore if not already there
5656 grep -qxF $dest .gitignore || echo -e " $dest " >> .gitignore
@@ -67,7 +67,7 @@ if [ -d $source/stubs ]; then
6767fi
6868
6969# Log the merging process
70- echo -e " ${Blue} Merge all package folder json files into top level xxx.json${End} "
70+ echo " ${Blue} Merge all package folder json files into top level xxx.json${End} "
7171
7272for package in package composer; do
7373
@@ -77,19 +77,20 @@ for package in package composer; do
7777 echo " {}" > $package .json
7878 else
7979 # Pre-sort the existing package.json
80- echo -e " ${Yellow} Pre-merge normalize $package .json${End} "
80+ echo " ${Yellow} Pre-merge normalize $package .json${End} "
8181 normalize-json -s -a -i -t ${tabSize:- 4} $package .json
8282 fi
8383
8484 # Merge all package folder json files into the top-level package.json
8585 find $source -maxdepth 1 -name _* .$package .json | sort | while read file; do
86- echo -e " ${Yellow} Merge $file in $package .json${End} "
86+ echo " ${Yellow} Merge $file in $package .json${End} "
8787 jq --indent ${tabSize:- 4} -s ' .[0] * .[1]' $file $package .json > /tmp/$package .json && mv -f /tmp/$package .json $package .json
8888 done
8989
9090done
9191
9292# Call all configure-xxx.sh scripts
9393find $source -maxdepth 1 -name configure-* .sh | sort | while read file; do
94- echo -e " ${Yellow} Run $file ${End} "
94+ echo " ${Yellow} Run $file ${End} "
95+ $file
9596done
0 commit comments