Improved both scripts

This commit is contained in:
Markus Fleschutz 2021-02-15 12:00:23 +01:00
parent 2cd0fcea5a
commit 0070c2cb97
2 changed files with 5 additions and 4 deletions

View File

@ -9,7 +9,7 @@
try { try {
& git --version & git --version
} catch { } catch {
write-error "Can't execute 'git' - make sure Git is installed and available" write-error "ERROR: can't execute 'git' - make sure Git is installed and available"
exit 1 exit 1
} }
@ -27,9 +27,10 @@ try {
} }
write-output "Cloning from $URL..." write-output "Cloning from $URL..."
& git clone --recurse-submodules $URL & git clone --recurse-submodules $URL
if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" }
} }
exit 0 exit 0
} catch { } catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1 exit 1
} }

View File

@ -11,7 +11,7 @@ param($Directory = "")
try { try {
& git --version & git --version
} catch { } catch {
write-error "Can't execute 'git' - make sure Git is installed and available" write-error "ERROR: can't execute 'git' - make sure Git is installed and available"
exit 1 exit 1
} }
@ -32,6 +32,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1 exit 1
} }