2828
2929# If 'all' argument is provided, set stubs and features to install all default features
3030if [ -n " $all " ]; then
31- echo -e " ${Yellow} Add default features${End} "
31+ echo " ${Yellow} Add default features${End} "
3232 stubs=1
3333 features=$( sed ' /^\s*\/\//d' $source /stubs/.devcontainer/devcontainer.json | jq -r ' .features | to_entries[] | select(.key | contains("tomgrv/devcontainer-features"))| .key|
3434 split("/")[-1] | split(":")[0]' )
3535fi
3636
3737# If 'upd' argument is provided, set stubs and features to update all features
3838if [ -n " $upd " ]; then
39- echo -e " ${Green} Update features${End} "
39+ echo " ${Green} Update features${End} "
4040 stubs=1
4141 features=$( sed ' /^\s*\/\//d' $source /.devcontainer/devcontainer.json | jq -r ' .features | to_entries[] | select(.key | contains("tomgrv/devcontainer-features"))| .key|
4242 split("/")[-1] | split(":")[0]' )
4343fi
4444
4545# If 'stubs' argument is provided, indicate that stubs are selected
4646if [ -n " $stubs " ]; then
47- echo -e " ${Green} Stubs selected${End} "
47+ echo " ${Green} Stubs selected${End} "
4848fi
4949
5050# If 'package' argument is provided, use the specified package.json file
5151if [ -n " $package " ]; then
5252 file=" $package "
5353 if [ ! -f " $file " ]; then
54- echo -e " ${Red} File not found: $file ${End} "
54+ echo " ${Red} File not found: $file ${End} "
5555 exit
5656 fi
5757
58- echo -e " ${Green} Using $file ${End} "
58+ echo " ${Green} Using $file ${End} "
5959
6060 # Extract features from the package.json file if not already set
6161 if [ -z " $features " ]; then
6565
6666# If no features are selected, display an error message
6767if [ -z " $features " ]; then
68- echo -e " ${Red} No features selected${End} "
68+ echo " ${Red} No features selected${End} "
6969else
70- echo -e " ${Green} Selected features: $features ${End} "
70+ echo " ${Green} Selected features: $features ${End} "
7171fi
7272
7373# Merge all files from the stub folder to the root using git merge-file if stubs are selected
7474if [ -n " $stubs " ]; then
75- echo -e " ${Yellow} Installing stubs...${End} "
75+ echo " ${Yellow} Installing stubs...${End} "
7676 $source /src/common-utils/_configure-feature.sh -s $source .
77- echo -e " ${Green} Stubs installed${End} "
77+ echo " ${Green} Stubs installed${End} "
7878fi
7979
8080# If features are selected, proceed with installation
@@ -86,44 +86,44 @@ if [ -n "$features" ]; then
8686 # Check if the script is running inside a container
8787 if [ " $CODESPACES " != " true" ] && [ " $REMOTE_CONTAINERS " != " true" ]; then
8888
89- echo -e " ${Red} You are not in a container${End} "
89+ echo " ${Red} You are not in a container${End} "
9090
9191 # Run the install.sh script for each selected feature
9292 for feature in $features ; do
9393 if [ -f " $source /src/$feature /install.sh" ]; then
94- echo -e " ${Yellow} Running src/$feature /install.sh...${End} "
94+ echo " ${Yellow} Running src/$feature /install.sh...${End} "
9595 sh $source /src/$feature /install.sh
96- echo -e " ${Green} $feature installed${End} "
96+ echo " ${Green} $feature installed${End} "
9797 else
98- echo -e " ${Red} $feature not found${End} "
98+ echo " ${Red} $feature not found${End} "
9999 fi
100100 done
101101
102102 # Run the configure.sh script for each selected feature
103103 for feature in $features ; do
104104 if [ -d " /tmp/$feature " ]; then
105- echo -e " ${Yellow} Configuring /tmp/$feature ...${End} "
105+ echo " ${Yellow} Configuring /tmp/$feature ...${End} "
106106 sh $source /src/common-utils/_configure-feature.sh -s /tmp/$feature $feature
107- echo -e " ${Green} $feature configured${End} "
107+ echo " ${Green} $feature configured${End} "
108108 else
109- echo -e " ${Red} $feature not found${End} "
109+ echo " ${Red} $feature not found${End} "
110110 fi
111111 done
112112
113113 elif [ -n " $stubs " ]; then
114114
115115 # stubs are selected, configure stubs of the selected features
116116 for feature in $features ; do
117- echo -e " ${Yellow} Deploying stubs for $feature ...${End} "
117+ echo " ${Yellow} Deploying stubs for $feature ...${End} "
118118 $source /src/common-utils/_configure-feature.sh -s $source /src/$feature $feature
119- echo -e " ${Green} Stubs for $feature deployed${End} "
119+ echo " ${Green} Stubs for $feature deployed${End} "
120120 done
121121
122122 else
123123 # If inside a container, suggest using devutils as devcontainer features
124- echo -e " ${Purple} You are in a container: use devutils as devcontainer features:${End} "
124+ echo " ${Purple} You are in a container: use devutils as devcontainer features:${End} "
125125 for feature in $features ; do
126- echo -e " ${Purple} ghcr.io/tomgrv/devcontainer-features/$feature ${End} "
126+ echo " ${Purple} ghcr.io/tomgrv/devcontainer-features/$feature ${End} "
127127 done
128128
129129 fi
0 commit comments