diff --git a/Scripts/cd-repos.ps1 b/Scripts/cd-repos.ps1 index db03b149..ec47ce02 100755 --- a/Scripts/cd-repos.ps1 +++ b/Scripts/cd-repos.ps1 @@ -1,11 +1,11 @@ <# .SYNOPSIS - Sets the working directory to the user's Git repositories folder + Sets the working directory to the user's repos folder .DESCRIPTION This PowerShell script changes the working directory to the user's Git repositories folder. .EXAMPLE PS> ./cd-repos - 📂/home/Markus/Repos + 📂C:\Users\Markus\Repos .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -15,7 +15,11 @@ try { $Path = Resolve-Path "$HOME/Repos" if (-not(Test-Path "$Path" -pathType container)) { - throw "Git repositories folder at 📂$Path doesn't exist (yet)" + $Path = Resolve-Path "$HOME/source/repos" + if (-not(Test-Path "$Path" -pathType container)) { + $Path = Resolve-Path "$HOME/Repos" + throw "Folder for Git repositories at 📂$Path doesn't exist (yet)" + } } Set-Location "$Path" "📂$Path" @@ -23,4 +27,4 @@ try { } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 -} +} \ No newline at end of file