File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,12 +77,13 @@ for package in package composer; do
7777 echo " {}" > $package .json
7878 else
7979 # Pre-sort the existing package.json
80+ echo " ${Yellow} Pre-merge normalize $package .json${None} "
8081 normalize-json -t ${tabSize:- 4} $package .json
8182 fi
8283
8384 # Merge all package folder json files into the top-level package.json
8485 find $source -maxdepth 1 -name _* .$package .json | sort | while read file; do
85- echo " ${Yellow} Merge $file ${None} "
86+ echo " ${Yellow} Merge $file in $package .json ${None} "
8687 jq --indent ${tabSize:- 4} -s ' .[0] * .[1]' $file $package .json > /tmp/$package .json && mv -f /tmp/$package .json $package .json
8788 done
8889
Original file line number Diff line number Diff line change @@ -608,12 +608,16 @@ if validate "$json" "$schema"; then
608608else
609609 echo -e " ${Red} JSON is empty or invalid${None} " >&2
610610 exit 1
611- fi | traverse $json > /tmp/$$ .json
611+ fi > /tmp/$$ .json
612612
613- if test -z " $save " ; then
614- jq -C --indent ${tabSize:- 2} . /tmp/$$ .json
615- else
616- jq -M --indent ${tabSize:- 4} . /tmp/$$ .json > $json
613+ # Handle output
614+ if test -s /tmp/$$ .json; then
615+ if test -z " $save " ; then
616+ traverse $json /tmp/$$ .json | jq -C --indent ${tabSize:- 2} .
617+ else
618+ traverse $json /tmp/$$ .json | jq -M --indent ${tabSize:- 4} . > $json
619+ fi
617620fi
618621
619- # rm -f /tmp/$$.json
622+ # Clean up
623+ rm -f /tmp/$$ .json
Original file line number Diff line number Diff line change 11{
22 "name" : " Common Utils" ,
3- "version" : " 3.3.0 " ,
3+ "version" : " 3.3.2 " ,
44 "description" : " Common utils for tomgrv/devcontainer-features" ,
55 "dependsOn" : {
66 "ghcr.io/devcontainers/features/common-utils" : {}
You can’t perform that action at this time.
0 commit comments