Skip to content

Commit

Permalink
Fix finding composer cache dir (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
TamasSzigeti committed Oct 8, 2023
1 parent 12e7194 commit c49029a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/composer_paths.sh
Expand Up @@ -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}"
Expand Down
15 changes: 15 additions & 0 deletions tests/expect/composer_paths_10.exp
@@ -0,0 +1,15 @@
#!/usr/bin/env -S expect -f

set timeout 3
# So we don't find a composer.lock in current dir
cd ..
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
"
expect eof

0 comments on commit c49029a

Please sign in to comment.