mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-08-09 15:14:39 +07:00
Update symfony-cli support to use new symfony-cli/symfony-cli
This commit is contained in:
@ -73,9 +73,6 @@ Function Add-ToolsHelper() {
|
||||
} elseif($tool -eq "phpDocumentor") {
|
||||
Add-Extension fileinfo >$null 2>&1
|
||||
Copy-Item $bin_dir\phpDocumentor.bat -Destination $bin_dir\phpdoc.bat
|
||||
} elseif($tool -eq "symfony-cli") {
|
||||
Add-ToProfile $current_profile "symfony" "New-Alias symfony $bin_dir\symfony-cli.exe"
|
||||
Add-ToProfile $current_profile "symfony_cli" "New-Alias symfony-cli $bin_dir\symfony-cli.exe"
|
||||
} elseif($tool -match "vapor-cli") {
|
||||
Copy-Item $env:vapor_cli_bin\vapor.bat -Destination $env:vapor_cli_bin\vapor-cli.bat
|
||||
} elseif($tool -eq "wp-cli") {
|
||||
|
@ -76,7 +76,7 @@ add_tools_helper() {
|
||||
fi
|
||||
elif [[ "$tool" =~ vapor-cli ]]; then
|
||||
sudo ln -s "$scoped_dir"/vendor/bin/vapor "$scoped_dir"/vendor/bin/vapor-cli
|
||||
elif [[ "$tool" =~ (symfony|vapor|wp)-cli ]]; then
|
||||
elif [ "$tool" = wp-cli ]; then
|
||||
sudo ln -s "$tool_path" "$tool_path_dir"/"${tool%-*}"
|
||||
fi
|
||||
}
|
||||
|
14
src/scripts/tools/symfony.ps1
Normal file
14
src/scripts/tools/symfony.ps1
Normal file
@ -0,0 +1,14 @@
|
||||
Function Add-Symfony() {
|
||||
$arch_name ='amd64'
|
||||
if(-not([Environment]::Is64BitOperatingSystem) -or $version -lt '7.0') {
|
||||
$arch_name = '386'
|
||||
}
|
||||
$url = "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_windows_${arch_name}.zip"
|
||||
Invoke-WebRequest -Uri $url -OutFile $bin_dir\symfony.zip >$null 2>&1
|
||||
Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force >$null 2>&1
|
||||
Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe >$null 2>&1
|
||||
Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe"
|
||||
Add-ToProfile $current_profile 'symfony_cli' "New-Alias symfony-cli $bin_dir\symfony-cli.exe"
|
||||
$tool_version = Get-ToolVersion symfony "-V"
|
||||
Add-Log $tick "symfony-cli" "Added symfony-cli $tool_version"
|
||||
}
|
13
src/scripts/tools/symfony.sh
Normal file
13
src/scripts/tools/symfony.sh
Normal file
@ -0,0 +1,13 @@
|
||||
add_symfony() {
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
echo 'deb [trusted=yes] https://repo.symfony.com/apt/ /' | sudo tee /etc/apt/sources.list.d/symfony-cli.list >/dev/null 2>&1
|
||||
update_lists symfony repo.symfony.com
|
||||
install_packages symfony-cli
|
||||
elif [ "$(uname -s)" = "Darwin" ]; then
|
||||
add_brew_tap symfony-cli/homebrew-tap
|
||||
brew install symfony-cli/tap/symfony-cli >/dev/null 2>&1
|
||||
fi
|
||||
sudo ln -s "$(command -v symfony)" "${tool_path_dir:?}"/symfony-cli
|
||||
tool_version=$(get_tool_version "symfony" "-V")
|
||||
add_log "${tick:?}" "symfony-cli" "Added symfony-cli $tool_version"
|
||||
}
|
Reference in New Issue
Block a user