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