Use Write-Error with ErrorAction as Stop instead of exit

This commit is contained in:
Shivam Mathur
2023-03-14 06:02:04 +05:30
parent 1b08836381
commit 5f422817a1
2 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@ Function Edit-ComposerConfig() {
php -r "try {`$p=new Phar('$tool_path.phar', 0);exit(0);} catch(Exception `$e) {exit(1);}"
if ($? -eq $False) {
Add-Log "$cross" "composer" "Could not download composer"
exit 1;
Write-Error "Error" -ErrorAction Stop
}
New-Item -ItemType Directory -Path $composer_bin -Force > $null 2>&1
if (-not(Test-Path $composer_json)) {