From cf0fdf35f2cd9875bd1dd5e83a972d328cacc289 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 4 May 2020 10:31:14 +0530 Subject: [PATCH] Add composer global bin directory to PATH --- src/scripts/darwin.sh | 2 +- src/scripts/linux.sh | 2 +- src/scripts/win32.ps1 | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 137da343..2f6ab1f2 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -108,6 +108,7 @@ add_tool() { sudo chmod a+x "$tool_path" if [ "$tool" = "composer" ]; then composer -q global config process-timeout 0 + echo "::add-path::/Users/runner/.composer/vendor/bin" if [ -n "$COMPOSER_TOKEN" ]; then composer -q global config github-oauth.github.com "$COMPOSER_TOKEN" fi @@ -135,7 +136,6 @@ add_composertool() { prefix=$3 ( composer global require "$prefix$release" >/dev/null 2>&1 && - sudo ln -sf "$(composer -q global config home)"/vendor/bin/"$tool" /usr/local/bin/"$tool" && add_log "$tick" "$tool" "Added" ) || add_log "$cross" "$tool" "Could not setup $tool" } diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 75b7b06c..33d1bde8 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -204,6 +204,7 @@ add_tool() { sudo chmod a+x "$tool_path" if [ "$tool" = "composer" ]; then composer -q global config process-timeout 0 + echo "::add-path::/home/runner/.composer/vendor/bin" if [ -n "$COMPOSER_TOKEN" ]; then composer -q global config github-oauth.github.com "$COMPOSER_TOKEN" fi @@ -229,7 +230,6 @@ add_composertool() { prefix=$3 ( composer global require "$prefix$release" >/dev/null 2>&1 && - sudo ln -sf "$(composer -q global config home)"/vendor/bin/"$tool" /usr/local/bin/"$tool" && add_log "$tick" "$tool" "Added" ) || add_log "$cross" "$tool" "Could not setup $tool" } diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 6c3d1719..2394b7f7 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -166,6 +166,7 @@ Function Add-Tool() { (Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr } elseif($tool -eq "composer") { composer -q global config process-timeout 0 + Write-Output "::add-path::C:/Users/runneradmin/AppData/Roaming/Composer/vendor/bin" if (Test-Path env:COMPOSER_TOKEN) { composer -q global config github-oauth.github.com $env:COMPOSER_TOKEN } @@ -199,8 +200,6 @@ Function Add-Composertool() { ) composer -q global require $prefix$release 2>&1 | out-null if($?) { - $composer_dir = composer -q global config home | ForEach-Object { $_ -replace "/", "\" } - Add-Content -Path $PsHome\profile.ps1 -Value "New-Alias $tool $composer_dir\vendor\bin\$tool.bat" Add-Log $tick $tool "Added" } else { Add-Log $cross $tool "Could not setup $tool"