mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-10 10:48:31 +02:00
Improve switch-branch.ps1
This commit is contained in:
parent
d01aa17c1f
commit
c5bb8480f7
@ -23,15 +23,15 @@ try {
|
||||
& "$PSScriptRoot/fetch-repo.ps1"
|
||||
if ($lastExitCode -ne "0") { throw "Script 'fetch-repo.ps1' failed" }
|
||||
|
||||
& git switch --recurse-submodules "$BranchName"
|
||||
& git switch "$BranchName"
|
||||
if ($lastExitCode -ne "0") { throw "'git switch $BranchName' failed" }
|
||||
|
||||
& git pull
|
||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
||||
|
||||
& git submodule update --init --recursive
|
||||
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
|
||||
|
||||
& git pull --recurse-submodules
|
||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
||||
|
||||
"✔️ switched Git repository 📂$RepoDir to branch 🌵$BranchName"
|
||||
exit 0
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user