mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-11 11:04:46 +02:00
Improved switch-branch.ps1
This commit is contained in:
parent
45abf86a17
commit
108f3ad743
@ -20,6 +20,10 @@ try {
|
|||||||
$Branch = read-host "Enter branch name to switch to"
|
$Branch = read-host "Enter branch name to switch to"
|
||||||
}
|
}
|
||||||
& git switch --recurse-submodules $Branch
|
& git switch --recurse-submodules $Branch
|
||||||
|
if ($lastExitCode -ne "0") {
|
||||||
|
throw "'git switch --recurse-submodules $Branch' failed"
|
||||||
|
}
|
||||||
|
& git status
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user