Skip to content

Commit

Permalink
Fix logs for symfony-cli on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Feb 24, 2022
1 parent 808396c commit 293da04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
14 changes: 9 additions & 5 deletions src/scripts/tools/symfony.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
11 changes: 8 additions & 3 deletions src/scripts/tools/symfony.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 293da04

Please sign in to comment.