mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-09 06:20:25 +01:00
Update fetch-repos.ps1 and pull-repos.ps1
This commit is contained in:
parent
cebc8fd9e2
commit
199b0f3162
@ -1,8 +1,8 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Fetches updates for Git repos
|
Fetches updates into Git repos
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script fetches updates for all Git repositories in a folder (including submodules).
|
This PowerShell script fetches updates into all Git repositories in a folder (including submodules).
|
||||||
.PARAMETER ParentDir
|
.PARAMETER ParentDir
|
||||||
Specifies the path to the parent folder
|
Specifies the path to the parent folder
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -43,7 +43,7 @@ try {
|
|||||||
if ($lastExitCode -ne "0") { throw "'git fetch' in $Folder failed with exit code $lastExitCode" }
|
if ($lastExitCode -ne "0") { throw "'git fetch' in $Folder failed with exit code $lastExitCode" }
|
||||||
}
|
}
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ Fetching updates for $NumFolders repositories in 📂$ParentDirName took $Elapsed sec"
|
"✔️ Fetching updates into $NumFolders repositories under 📂$ParentDirName took $Elapsed sec"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Pulls updates for Git repos
|
Pulls updates into Git repos
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script pulls updates for all Git repositories in a folder (including submodules).
|
This PowerShell script pulls updates into all Git repositories in a folder (including submodules).
|
||||||
.PARAMETER ParentDir
|
.PARAMETER ParentDir
|
||||||
Specifies the path to the parent folder
|
Specifies the path to the parent folder
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -47,7 +47,7 @@ try {
|
|||||||
$Step++
|
$Step++
|
||||||
}
|
}
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ Pulling updates for $NumFolders repositories in 📂$ParentDirName took $Elapsed sec ($Failed failed)"
|
"✔️ Pulling updates into $NumFolders repositories under 📂$ParentDirName took $Elapsed sec ($Failed failed)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user