From 838fbb76b2627b336110648ad472357713488d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Szigeti?= Date: Fri, 30 Sep 2022 08:24:09 +0200 Subject: [PATCH 1/4] Fix finding composer cache dir --- bin/composer_paths.sh | 2 +- tests/expect/composer_paths_10.exp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 tests/expect/composer_paths_10.exp diff --git a/bin/composer_paths.sh b/bin/composer_paths.sh index 4d96a68..3f345e0 100755 --- a/bin/composer_paths.sh +++ b/bin/composer_paths.sh @@ -46,7 +46,7 @@ if [ ! -f "${composer_lock}" ]; then fi composer_version="$($composer_path --version)" -cache_dir="$($composer_path config cache-dir)" +cache_dir="$($composer_path --working-dir "${working_directory}" config cache-dir)" echo "::debug::Composer path is '${composer_path}'" echo "::debug::${composer_version}" diff --git a/tests/expect/composer_paths_10.exp b/tests/expect/composer_paths_10.exp new file mode 100755 index 0000000..727cc58 --- /dev/null +++ b/tests/expect/composer_paths_10.exp @@ -0,0 +1,18 @@ +#!/usr/bin/env -S expect -f + +set timeout 3 +cd .. # So we don't find a composer.lock in current dir +spawn ../bin/composer_paths.sh "" "fixtures/with-lock-file" +match_max 100000 + +expect "::debug::Composer path is '*'\r +::debug::Composer version *\r +::debug::Composer cache directory found at '*composer*'\r +::debug::File composer.json found at 'fixtures/with-lock-file/composer.json'\r +::debug::File composer.lock path computed as 'fixtures/with-lock-file/composer.lock'\r +::set-output name=command::*\r +::set-output name=cache-dir::*\r +::set-output name=json::fixtures/with-lock-file/composer.json\r +::set-output name=lock::fixtures/with-lock-file/composer.lock\r +" +expect eof From 2624dc59217fb64204cd11e0c2ea00973378df35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Szigeti?= Date: Fri, 30 Sep 2022 08:39:57 +0200 Subject: [PATCH 2/4] comment fix --- tests/expect/composer_paths_10.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/expect/composer_paths_10.exp b/tests/expect/composer_paths_10.exp index 727cc58..de485e8 100755 --- a/tests/expect/composer_paths_10.exp +++ b/tests/expect/composer_paths_10.exp @@ -1,7 +1,8 @@ #!/usr/bin/env -S expect -f set timeout 3 -cd .. # So we don't find a composer.lock in current dir +# So we don't find a composer.lock in current dir +cd .. spawn ../bin/composer_paths.sh "" "fixtures/with-lock-file" match_max 100000 From 79c270086b7b2804077492d881220fb3df793b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Szigeti?= Date: Thu, 3 Nov 2022 22:17:46 +0100 Subject: [PATCH 3/4] Adjust test for githu output changes --- tests/expect/composer_paths_10.exp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/expect/composer_paths_10.exp b/tests/expect/composer_paths_10.exp index de485e8..3c950f7 100755 --- a/tests/expect/composer_paths_10.exp +++ b/tests/expect/composer_paths_10.exp @@ -11,9 +11,5 @@ expect "::debug::Composer path is '*'\r ::debug::Composer cache directory found at '*composer*'\r ::debug::File composer.json found at 'fixtures/with-lock-file/composer.json'\r ::debug::File composer.lock path computed as 'fixtures/with-lock-file/composer.lock'\r -::set-output name=command::*\r -::set-output name=cache-dir::*\r -::set-output name=json::fixtures/with-lock-file/composer.json\r -::set-output name=lock::fixtures/with-lock-file/composer.lock\r " expect eof From d68c9ba9d09e39fd398a0c72be5917fa59f895fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Szigeti?= Date: Sun, 8 Oct 2023 16:48:28 +0200 Subject: [PATCH 4/4] Use equal sign for BC --- bin/composer_paths.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/composer_paths.sh b/bin/composer_paths.sh index 3f345e0..decf725 100755 --- a/bin/composer_paths.sh +++ b/bin/composer_paths.sh @@ -46,7 +46,7 @@ if [ ! -f "${composer_lock}" ]; then fi composer_version="$($composer_path --version)" -cache_dir="$($composer_path --working-dir "${working_directory}" config cache-dir)" +cache_dir="$($composer_path --working-dir="${working_directory}" config cache-dir)" echo "::debug::Composer path is '${composer_path}'" echo "::debug::${composer_version}"