mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
fix(jump): correct error handling in getmark function
This commit fixes a bug in the `getmark` function where it would not correctly handle non-existent marks. The previous implementation would swallow the error from `realpath`, causing the `||` condition to not be triggered. This has been corrected by removing the command substitution and directly checking the exit code of `realpath`. The error message is now correctly printed to stderr, and the function returns a non-zero exit code on failure.
This commit is contained in:
parent
0d44fd642a
commit
dff57f2dd3
1 changed files with 1 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ marks() {
|
|||
}
|
||||
|
||||
function getmark {
|
||||
LANG= command echo $(command realpath "$MARKPATH/$1") || command echo "No such mark: $1"
|
||||
LANG= command realpath "$MARKPATH/$1" 2>/dev/null || { command echo "No such mark: $1" >&2; return 1; }
|
||||
}
|
||||
|
||||
_completemarks() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue