mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-07-15 03:45:00 +02:00
Improve switch-branch.ps1
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user