mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-24 12:46:43 +01:00
Update cd-repos.ps1
This commit is contained in:
parent
26ad83c417
commit
c72e01facb
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script changes the working directory to the user's Git repositories folder.
|
This PowerShell script changes the working directory to the user's Git repositories folder.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./cd-repos
|
PS> ./cd-repos
|
||||||
📂C:\Users\Markus\Repos
|
📂C:\Users\Markus\source\repos
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -13,14 +13,10 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Path = Resolve-Path "$HOME/Repos"
|
|
||||||
if (-not(Test-Path "$Path" -pathType container)) {
|
|
||||||
$Path = Resolve-Path "$HOME/source/repos"
|
$Path = Resolve-Path "$HOME/source/repos"
|
||||||
if (-not(Test-Path "$Path" -pathType container)) {
|
if (-not(Test-Path "$Path" -pathType container)) {
|
||||||
$Path = Resolve-Path "$HOME/Repos"
|
|
||||||
throw "Folder for Git repositories at 📂$Path doesn't exist (yet)"
|
throw "Folder for Git repositories at 📂$Path doesn't exist (yet)"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Set-Location "$Path"
|
Set-Location "$Path"
|
||||||
"📂$Path"
|
"📂$Path"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
Reference in New Issue
Block a user