mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-20 20:58:37 +01:00
Updated cd-repo.ps1 and clean-repo.ps1
This commit is contained in:
parent
9063f34652
commit
1aca3e811a
@ -7,7 +7,8 @@
|
|||||||
Specifies the folder name of the Git repository
|
Specifies the folder name of the Git repository
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./cd-repo.ps1 rust
|
PS> ./cd-repo.ps1 rust
|
||||||
📂C:\Repos\rust · on branch: ## main ... origin/main
|
📂C:\Repos\rust
|
||||||
|
🌿on branch: ## main ... origin/main
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -38,7 +39,7 @@ try {
|
|||||||
|
|
||||||
$path = Resolve-Path "$path"
|
$path = Resolve-Path "$path"
|
||||||
Set-Location "$path"
|
Set-Location "$path"
|
||||||
Write-Host "📂$path · on branch: " -noNewline
|
Write-Host "📂$path`n🌿on branch: " -noNewline
|
||||||
& git status --short --branch --show-stash
|
& git status --short --branch --show-stash
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
⏳ (2/4) Checking local repository... C:\Repos\rust
|
⏳ (2/4) Checking local repository... C:\Repos\rust
|
||||||
⏳ (3/4) Removing untracked files in repository...
|
⏳ (3/4) Removing untracked files in repository...
|
||||||
⏳ (4/4) Removing untracked files in submodules...
|
⏳ (4/4) Removing untracked files in submodules...
|
||||||
✅ Repo 📂rust successfully cleaned up in 2s.
|
✅ Cleaned up repo 📂rust in 2s.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -45,7 +45,7 @@ try {
|
|||||||
if ($lastExitCode -ne "0") { throw "'git clean' in the submodules failed with exit code $lastExitCode" }
|
if ($lastExitCode -ne "0") { throw "'git clean' in the submodules failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Repo 📂$repoName successfully cleaned up in $($elapsed)s."
|
"✅ Cleaned up repo 📂$repoName in $($elapsed)s."
|
||||||
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