Improve the error messages

This commit is contained in:
Markus Fleschutz
2022-03-03 09:49:58 +01:00
parent e1feb43253
commit 59c4596271
5 changed files with 16 additions and 16 deletions

View File

@ -33,13 +33,13 @@ try {
if (($Mode -eq "locally") -or ($Mode -eq "both")) {
"Removing local tag..."
& git -C "$RepoDir" tag --delete $TagName
if ($lastExitCode -ne "0") { throw "'git tag --delete' failed" }
if ($lastExitCode -ne "0") { throw "'git tag --delete' failed with exit code $lastExitCode" }
}
if (($Mode -eq "remote") -or ($Mode -eq "both")) {
"Removing remote tag..."
& git -C "$RepoDir" push origin :refs/tags/$TagName
if ($lastExitCode -ne "0") { throw "'git push origin' failed" }
if ($lastExitCode -ne "0") { throw "'git push origin' failed with exit code $lastExitCode" }
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds