Don't add common or excluded directories to the db
This commit is contained in:
10
z.ps1
10
z.ps1
@@ -83,11 +83,15 @@ function Add-ToZDatabase {
|
||||
$Add += "\";
|
||||
}
|
||||
|
||||
# Check so we don't match $HOME
|
||||
if ($Add -eq $env:HOME) { return $null; }
|
||||
# Check so we don't match $HOME. The logic here (I think) is that it's
|
||||
# already easy to jump to home with ~, we don't need another shortcut.
|
||||
if (($Add -eq $env:HOME) -or ($Add -eq $env:USERPROFILE)) {
|
||||
Set-Location -Path $Add; return;
|
||||
}
|
||||
|
||||
# Don't track excluded directories
|
||||
if (($env:_Z_EXCLUDE_DIRS -ne $null) -and ($env:_Z_EXCLUDE_DIRS -contains $Add)) {
|
||||
if (($null -ne $env:_Z_EXCLUDE_DIRS) -and ($env:_Z_EXCLUDE_DIRS -contains $Add)) {
|
||||
Set-Location -Path $Add;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user