mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-22 20:51:17 +01:00
Improve pull-repo.ps1
This commit is contained in:
parent
d112db2e7b
commit
b9778d28fe
@ -16,14 +16,13 @@ try {
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
"🢃 Pulling updates..."
|
||||
$Result = (git pull --recurse-submodules --jobs=4)
|
||||
if ($lastExitCode -ne "0") {
|
||||
if ("$Result" -match "You are not currently on a branch.") {
|
||||
"NOTE: not on a branch, nothing to pull"
|
||||
} else {
|
||||
throw "'git pull' failed"
|
||||
}
|
||||
$Result = (git status)
|
||||
if ("$Result" -match "HEAD detached at ") {
|
||||
write-warning "Not on a branch, so nothing to pull (in detached head state)"
|
||||
} else {
|
||||
"🢃 Pulling updates..."
|
||||
& git pull --recurse-submodules --jobs=4
|
||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
||||
}
|
||||
|
||||
$RepoDirName = (get-item "$RepoDir").Name
|
||||
|
Loading…
Reference in New Issue
Block a user