mirror of
https://github.com/iridakos/goto.git
synced 2025-05-16 15:30:22 -07:00
Merge pull request #62 from luotaipeng/master
Improve goto the special directory similar to system cd command
This commit is contained in:
commit
a9ad435067
6
goto.sh
6
goto.sh
@ -272,6 +272,12 @@ _goto_cleanup()
|
|||||||
# Changes to the given alias' directory
|
# Changes to the given alias' directory
|
||||||
_goto_directory()
|
_goto_directory()
|
||||||
{
|
{
|
||||||
|
# directly goto the special name that unable register, eg: ~
|
||||||
|
if ! [[ $1 =~ ^[[:alnum:]]+[a-zA-Z0-9_-]*$ ]]; then
|
||||||
|
{ builtin cd "$1" 2> /dev/null && return 0; } || \
|
||||||
|
{ _goto_error "Failed to goto '$1'" && return 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
local target
|
local target
|
||||||
|
|
||||||
target=$(_goto_resolve_alias "$1") || return 1
|
target=$(_goto_resolve_alias "$1") || return 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user