From 846135c190e848488012c07c5a05d99b7a2abe25 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 2 May 2022 11:22:58 +0530 Subject: [PATCH] Create empty composer.json in scoped directory When installing composer based tools in a scoped directory with old composer versions it breaks if a composer.json is not present in the scoped directory --- src/scripts/tools/add_tools.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scripts/tools/add_tools.sh b/src/scripts/tools/add_tools.sh index 8f34d6dc..06a9a7e2 100644 --- a/src/scripts/tools/add_tools.sh +++ b/src/scripts/tools/add_tools.sh @@ -142,6 +142,7 @@ add_composertool_helper() { scoped_dir="$composer_bin/_tools/$tool-$(echo -n "$release" | shasum -a 256 | cut -d ' ' -f 1)" if ! [ -d "$scoped_dir" ]; then mkdir -p "$scoped_dir" + echo '{}' | tee "$scoped_dir/composer.json" >/dev/null composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1 composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1 fi