mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 18:19:32 +02:00
Improve pull-repo.ps1
This commit is contained in:
parent
b9778d28fe
commit
f0d82b8342
@ -18,16 +18,16 @@ try {
|
||||
|
||||
$Result = (git status)
|
||||
if ("$Result" -match "HEAD detached at ") {
|
||||
write-warning "Not on a branch, so nothing to pull (in detached head state)"
|
||||
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
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ pulled updates for Git repository 📂$RepoDirName in $Elapsed sec"
|
||||
$RepoDirName = (get-item "$RepoDir").Name
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ pulled updates for Git repository 📂$RepoDirName in $Elapsed sec"
|
||||
}
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user