Fix logs for symfony-cli on failure

This commit is contained in:
Shivam Mathur 2022-02-24 23:01:58 +05:30
parent 808396c4e6
commit 293da043d1
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 17 additions and 8 deletions

View File

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

View File

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