mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-09 10:04:45 +02:00
Improve output of switch-branch.ps1
This commit is contained in:
parent
f37ada4a70
commit
1a2abfaf61
@ -17,7 +17,7 @@ try {
|
||||
|
||||
$Result = (git status)
|
||||
if ($lastExitCode -ne "0") { throw "'git status' failed in $RepoDir" }
|
||||
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Repository is NOT clean: $Result" }
|
||||
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Git repository is NOT clean: $Result" }
|
||||
|
||||
& "$PSScriptRoot/fetch-repo.ps1"
|
||||
if ($lastExitCode -ne "0") { throw "Script 'fetch-repo.ps1' failed" }
|
||||
@ -31,6 +31,7 @@ try {
|
||||
& git pull --recurse-submodules
|
||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
||||
|
||||
"✔️switched Git repository 📂$RepoDir to branch 🌵$BranchName"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user