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