mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-24 10:58:16 +02:00
Updated cd-repo.ps1
This commit is contained in:
parent
37075acd8c
commit
c6929fc266
@ -19,24 +19,16 @@ param([string]$folderName = "")
|
||||
try {
|
||||
if ("$folderName" -eq "") { $folderName = Read-Host "Enter the Git repository's folder name" }
|
||||
|
||||
if (Test-Path "~/Repos" -pathType Container) { # try short name in home dir
|
||||
$path = "~/Repos"
|
||||
} elseif (Test-Path "~/repos" -pathType Container) {
|
||||
$path = "~/repos"
|
||||
} elseif (Test-Path "~/Repositories" -pathType Container) { # try long name
|
||||
$path = "~/Repositories"
|
||||
} elseif (Test-Path "~/repositories" -pathType Container) {
|
||||
$path = "~/repositories"
|
||||
} elseif (Test-Path "/Repos" -pathType Container) { # try short name in root dir
|
||||
$path = "/Repos"
|
||||
} elseif (Test-Path "/repos" -pathType Container) {
|
||||
$path = "/repos"
|
||||
} elseif (Test-Path "/Repositories" -pathType Container) { # try long name
|
||||
$path = "/Repositories"
|
||||
} elseif (Test-Path "/repositories" -pathType Container) {
|
||||
$path = "/repositories"
|
||||
} elseif (Test-Path "~/source/repos" -pathType Container) { # try Visual Studio default
|
||||
$path = "~/source/repos"
|
||||
if (Test-Path "~/Repos" -pathType container) { $path = "~/Repos"
|
||||
} elseif (Test-Path "~/repos" -pathType container) { $path = "~/repos"
|
||||
} elseif (Test-Path "~/Repositories" -pathType container) { $path = "~/Repositories"
|
||||
} elseif (Test-Path "~/repositories" -pathType container) { $path = "~/repositories"
|
||||
} elseif (Test-Path "/Repos" -pathType container) { $path = "/Repos"
|
||||
} elseif (Test-Path "/repos" -pathType container) { $path = "/repos"
|
||||
} elseif (Test-Path "/Repositories" -pathType container) { $path = "/Repositories"
|
||||
} elseif (Test-Path "/repositories" -pathType container) { $path = "/repositories"
|
||||
} elseif (Test-Path "~/source/repos" -pathType container) { $path = "~/source/repos" # Visual Studio default
|
||||
} elseif (Test-Path "D:/Repos" -pathType container) { $path = "D:/Repos" # second HDD
|
||||
} else {
|
||||
throw "No Git repositories folder in your home directory or in the root folder yet"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user