@@ -412,8 +412,8 @@ __gump_pwd_hook() { |
| 412 | 412 | command cd ~ && __gump_hook |
| 413 | 413 | elif [[ $# -eq 1 && "$1" == "-" ]]; then |
| 414 | 414 | command cd - && __gump_hook |
| 415 | | - elif [[ $# -eq 1 && -d "$1" ]]; then |
| 416 | | - command cd -- "$1" && __gump_hook |
| 415 | + elif [ $# -eq 1 ] && [ -d "$1" ]; then |
| 416 | + command cd "$1" && __gump_hook |
| 417 | 417 | else |
| 418 | 418 | local result |
| 419 | 419 | result=$(command gump query --cwd -- "$@" 2>/dev/null) |
@@ -421,7 +421,7 @@ __gump_pwd_hook() { |
| 421 | 421 | result=$(command gump query -- "$@" 2>/dev/null) |
| 422 | 422 | fi |
| 423 | 423 | if [[ -n "$result" ]]; then |
| 424 | | - command cd -- "$result" && __gump_hook |
| 424 | + command cd "$result" && __gump_hook |
| 425 | 425 | else |
| 426 | 426 | echo "gump: no match found" >&2 |
| 427 | 427 | return 1 |
@@ -434,7 +434,7 @@ __gump_pwd_hook() { |
| 434 | 434 | local result |
| 435 | 435 | result=$(command gump query --all -- "$@" | fzf --height=40% --reverse) |
| 436 | 436 | if [[ -n "$result" ]]; then |
| 437 | | - command cd -- "$result" && __gump_hook |
| 437 | + command cd "$result" && __gump_hook |
| 438 | 438 | fi |
| 439 | 439 | }} |
| 440 | 440 | "#, |
@@ -447,8 +447,8 @@ __gump_pwd_hook() { |
| 447 | 447 | # No-prefix directory jumping |
| 448 | 448 | command_not_found_handle() { |
| 449 | 449 | # Check if it's a local directory first (exact match) |
| 450 | | - if [[ -d "$1" ]]; then |
| 451 | | - command cd -- "$1" && __gump_hook |
| 450 | + if [ -d "$1" ]; then |
| 451 | + command cd "$1" && __gump_hook |
| 452 | 452 | return 0 |
| 453 | 453 | fi |
| 454 | 454 | |
@@ -456,14 +456,14 @@ command_not_found_handle() { |
| 456 | 456 | local result |
| 457 | 457 | result=$(command gump query --cwd -- "$@" 2>/dev/null) |
| 458 | 458 | if [[ -n "$result" ]]; then |
| 459 | | - command cd -- "$result" && __gump_hook |
| 459 | + command cd "$result" && __gump_hook |
| 460 | 460 | return 0 |
| 461 | 461 | fi |
| 462 | 462 | |
| 463 | 463 | # Query gump database |
| 464 | 464 | result=$(command gump query -- "$@" 2>/dev/null) |
| 465 | 465 | if [[ -n "$result" ]]; then |
| 466 | | - command cd -- "$result" && __gump_hook |
| 466 | + command cd "$result" && __gump_hook |
| 467 | 467 | return 0 |
| 468 | 468 | fi |
| 469 | 469 | |