mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-15 07:12:44 +02:00
Updated sync-repo.ps1
This commit is contained in:
@ -4,14 +4,14 @@
|
|||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script synchronizes a local Git repository by pull and push (including submodules).
|
This PowerShell script synchronizes a local Git repository by pull and push (including submodules).
|
||||||
.PARAMETER path
|
.PARAMETER path
|
||||||
Specifies the path to the Git repository (current working directory by default)
|
Specifies the file path to the Git repository (current working directory by default)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./sync-repo.ps1 C:\Repos\curl
|
PS> ./sync-repo.ps1 C:\Repos\curl
|
||||||
⏳ (1/4) Searching for Git executable... git version 2.42.0.windows.1
|
⏳ (1/4) Searching for Git executable... git version 2.42.0.windows.1
|
||||||
⏳ (2/4) Checking local repository... C:\Repos\curl
|
⏳ (2/4) Checking local repository... C:\Repos\curl
|
||||||
⏳ (3/4) Pulling remote updates... Already up to date.
|
⏳ (3/4) Pulling remote updates... Already up to date.
|
||||||
⏳ (4/4) Pushing local updates... Everything up-to-date
|
⏳ (4/4) Pushing local updates... Everything up-to-date
|
||||||
✅ Synced the 📂curl repo in 5s.
|
✅ Repo 'curl' synchronized in 5s.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -40,9 +40,9 @@ try {
|
|||||||
|
|
||||||
$pathName = (Get-Item "$path").Name
|
$pathName = (Get-Item "$path").Name
|
||||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Synced the 📂$pathName repo in $($elapsed)s."
|
"✅ Repo '$pathName' synchronized in $($elapsed)s."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ ERROR: $($Error[0]) in script line $($_.InvocationInfo.ScriptLineNumber)."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user