mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Add composer global bin directory to PATH
This commit is contained in:
parent
8830cdd08c
commit
cf0fdf35f2
@ -108,6 +108,7 @@ add_tool() {
|
|||||||
sudo chmod a+x "$tool_path"
|
sudo chmod a+x "$tool_path"
|
||||||
if [ "$tool" = "composer" ]; then
|
if [ "$tool" = "composer" ]; then
|
||||||
composer -q global config process-timeout 0
|
composer -q global config process-timeout 0
|
||||||
|
echo "::add-path::/Users/runner/.composer/vendor/bin"
|
||||||
if [ -n "$COMPOSER_TOKEN" ]; then
|
if [ -n "$COMPOSER_TOKEN" ]; then
|
||||||
composer -q global config github-oauth.github.com "$COMPOSER_TOKEN"
|
composer -q global config github-oauth.github.com "$COMPOSER_TOKEN"
|
||||||
fi
|
fi
|
||||||
@ -135,7 +136,6 @@ add_composertool() {
|
|||||||
prefix=$3
|
prefix=$3
|
||||||
(
|
(
|
||||||
composer global require "$prefix$release" >/dev/null 2>&1 &&
|
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 "$tick" "$tool" "Added"
|
||||||
) || add_log "$cross" "$tool" "Could not setup $tool"
|
) || add_log "$cross" "$tool" "Could not setup $tool"
|
||||||
}
|
}
|
||||||
|
@ -204,6 +204,7 @@ add_tool() {
|
|||||||
sudo chmod a+x "$tool_path"
|
sudo chmod a+x "$tool_path"
|
||||||
if [ "$tool" = "composer" ]; then
|
if [ "$tool" = "composer" ]; then
|
||||||
composer -q global config process-timeout 0
|
composer -q global config process-timeout 0
|
||||||
|
echo "::add-path::/home/runner/.composer/vendor/bin"
|
||||||
if [ -n "$COMPOSER_TOKEN" ]; then
|
if [ -n "$COMPOSER_TOKEN" ]; then
|
||||||
composer -q global config github-oauth.github.com "$COMPOSER_TOKEN"
|
composer -q global config github-oauth.github.com "$COMPOSER_TOKEN"
|
||||||
fi
|
fi
|
||||||
@ -229,7 +230,6 @@ add_composertool() {
|
|||||||
prefix=$3
|
prefix=$3
|
||||||
(
|
(
|
||||||
composer global require "$prefix$release" >/dev/null 2>&1 &&
|
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 "$tick" "$tool" "Added"
|
||||||
) || add_log "$cross" "$tool" "Could not setup $tool"
|
) || add_log "$cross" "$tool" "Could not setup $tool"
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,7 @@ Function Add-Tool() {
|
|||||||
(Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr
|
(Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr
|
||||||
} elseif($tool -eq "composer") {
|
} elseif($tool -eq "composer") {
|
||||||
composer -q global config process-timeout 0
|
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) {
|
if (Test-Path env:COMPOSER_TOKEN) {
|
||||||
composer -q global config github-oauth.github.com $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
|
composer -q global require $prefix$release 2>&1 | out-null
|
||||||
if($?) {
|
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"
|
Add-Log $tick $tool "Added"
|
||||||
} else {
|
} else {
|
||||||
Add-Log $cross $tool "Could not setup $tool"
|
Add-Log $cross $tool "Could not setup $tool"
|
||||||
|
Loading…
Reference in New Issue
Block a user