mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Add stopwatch to pull-repo.ps1
This commit is contained in:
parent
b29648cd42
commit
cfaa7b48da
@ -8,6 +8,8 @@
|
||||
param($RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
set-location "$RepoDir"
|
||||
|
||||
@ -20,7 +22,8 @@ try {
|
||||
& git pull --recurse-submodules --jobs=4
|
||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
||||
|
||||
"✔️ updated Git repository 📂$RepoDirName"
|
||||
[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