Add composer global bin directory to PATH

This commit is contained in:
Shivam Mathur 2020-05-04 10:31:14 +05:30
parent 8830cdd08c
commit cf0fdf35f2
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
3 changed files with 3 additions and 4 deletions

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"