diff --git a/src/scripts/tools/symfony.ps1 b/src/scripts/tools/symfony.ps1 index e5301222..c52cc22f 100644 --- a/src/scripts/tools/symfony.ps1 +++ b/src/scripts/tools/symfony.ps1 @@ -6,9 +6,13 @@ Function Add-Symfony() { $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" + if(Test-Path $bin_dir\symfony.exe) { + 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" + } else { + Add-Log $cross "symfony-cli" "Could not setup symfony-cli" + } } diff --git a/src/scripts/tools/symfony.sh b/src/scripts/tools/symfony.sh index d20d4909..b7c0ccef 100644 --- a/src/scripts/tools/symfony.sh +++ b/src/scripts/tools/symfony.sh @@ -7,7 +7,12 @@ add_symfony() { 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" + symfony_path="$(command -v symfony)" + if [[ -n "$symfony_path" ]]; then + sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli + tool_version=$(get_tool_version "symfony" "-V") + add_log "${tick:?}" "symfony-cli" "Added symfony-cli $tool_version" + else + add_log "${cross:?}" "symfony-cli" "Could not setup symfony-cli" + fi }