mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-21 09:28:21 +02:00
Improved both scripts
This commit is contained in:
parent
2cd0fcea5a
commit
0070c2cb97
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user