Updated cd-repos.ps1

This commit is contained in:
Markus Fleschutz 2024-03-13 11:11:42 +01:00
parent 714f53a90a
commit 1fd0b93746

View File

@ -7,7 +7,11 @@
Specifies an additional relative subpath (optional) Specifies an additional relative subpath (optional)
.EXAMPLE .EXAMPLE
PS> ./cd-repos PS> ./cd-repos
📂C:\Users\Markus\source\Repos 📂C:\Users\Markus\Repos
PS> ./cd-repos rust
📂C:\Users\Markus\Repos\rust
on branch: ## main ... origin/main
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -35,7 +39,11 @@ try {
$path = Resolve-Path "$path" $path = Resolve-Path "$path"
Set-Location "$path" Set-Location "$path"
"📂$path" "📂$path"
if ("$subpath" -ne "") { & git status --short --branch --show-stash }
if ("$subpath" -ne "") {
Write-Host -noNewline " on branch: "
& git status --short --branch --show-stash
}
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0])" "⚠️ Error: $($Error[0])"