1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 09:51:44 +08:00

fix(jump)!: only resolve mark symlink (#11074)

BREAKING CHANGE: Previously, `jump` would resolve the symlink to the mark directory and resolve again if the mark directory was also a symlink. It only resolves once after this commit.
This commit is contained in:
ditzy 2024-01-25 03:19:01 -06:00 committed by GitHub
parent e656377d36
commit 652037ebdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,8 +8,10 @@
#
export MARKPATH=$HOME/.marks
jump() {
builtin cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1}
local markpath="$(readlink $MARKPATH/$1)" || {echo "No such mark: $1"; return 1}
builtin cd "$markpath" 2>/dev/null || {echo "Destination does not exist for mark [$1]: $markpath"; return 2}
}
mark() {