mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-13 22:38:46 +02:00
Update the cd-*.ps1 scripts and add cd-fonts.ps1
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
This PowerShell script changes the working directory to the user's Git repositories folder.
|
||||
.EXAMPLE
|
||||
PS> ./cd-repos
|
||||
📂/home/markus/Repos
|
||||
📂/home/Joe/Repos
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -13,12 +13,12 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
$TargetDir = resolve-path "$HOME/Repos"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
throw "Git repositories folder at 📂$TargetDir doesn't exist (yet)"
|
||||
$Path = resolve-path "$HOME/Repos"
|
||||
if (-not(test-path "$Path" -pathType container)) {
|
||||
throw "Git repositories folder at 📂$Path doesn't exist (yet)"
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
set-location "$Path"
|
||||
"📂$Path"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
|
Reference in New Issue
Block a user