mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-10-30 23:07:56 +07:00 
			
		
		
		
	Add composer global bin directory to PATH
This commit is contained in:
		| @ -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" | ||||
| } | ||||
|  | ||||
| @ -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" | ||||
| } | ||||
|  | ||||
| @ -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" | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shivam Mathur
					Shivam Mathur