tenseleyflow/gump / 048dad1

Browse files

fix: respect explicit paths in g function

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
048dad186364e683096a505d4f0420807196c0ba
Parents
ac1f8d1
Tree
a6aab16

3 changed files

StatusFile+-
M Cargo.lock 1 1
M Cargo.toml 1 1
M src/cmd/init.rs 9 0
Cargo.lockmodified
@@ -290,7 +290,7 @@ dependencies = [
290290
 
291291
 [[package]]
292292
 name = "gump"
293
-version = "0.2.0"
293
+version = "0.2.1"
294294
 dependencies = [
295295
  "bincode",
296296
  "chrono",
Cargo.tomlmodified
@@ -1,6 +1,6 @@
11
 [package]
22
 name = "gump"
3
-version = "0.2.1"
3
+version = "0.2.2"
44
 edition = "2021"
55
 description = "A smarter cd command - zoxide without the z"
66
 authors = ["mfwolffe"]
src/cmd/init.rsmodified
@@ -62,6 +62,9 @@ fi
6262
         builtin cd ~ && __gump_hook
6363
     elif [[ $# -eq 1 && "$1" == "-" ]]; then
6464
         builtin cd - && __gump_hook
65
+    elif [[ $# -eq 1 && -d "$1" ]]; then
66
+        # Explicit path - cd directly without fuzzy matching
67
+        builtin cd -- "$1" && __gump_hook
6568
     else
6669
         local result
6770
         # Try CWD first, then database
@@ -162,6 +165,9 @@ __gump_hook() {
162165
         builtin cd ~
163166
     elif [[ $# -eq 1 && "$1" == "-" ]]; then
164167
         builtin cd -
168
+    elif [[ $# -eq 1 && -d "$1" ]]; then
169
+        # Explicit path - cd directly without fuzzy matching
170
+        builtin cd -- "$1"
165171
     else
166172
         local result
167173
         # Try CWD first, then database
@@ -281,6 +287,9 @@ function {cmd} --description "Jump to a directory"
281287
         cd ~
282288
     else if test (count $argv) -eq 1 -a "$argv[1]" = "-"
283289
         cd -
290
+    else if test (count $argv) -eq 1 -a -d "$argv[1]"
291
+        # Explicit path - cd directly without fuzzy matching
292
+        cd $argv[1]
284293
     else
285294
         # Try CWD first, then database
286295
         set -l result (command gump query --cwd -- $argv 2>/dev/null)