]> Sergey Matveev's repositories - nnn.git/commitdiff
Combine assignment of $_Z_DATA, $Z_DATA or $HOME/.z
authorMax Schillinger <maxschillinger@web.de>
Sun, 26 Sep 2021 21:17:51 +0000 (23:17 +0200)
committerGitHub <noreply@github.com>
Sun, 26 Sep 2021 21:17:51 +0000 (23:17 +0200)
Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
plugins/autojump

index 50e2a81c2f1560b358d1cca20e13fbd2dfd55a7a..21a28ea8d7ca1a288b982b19290f67287bcfc941 100755 (executable)
@@ -43,8 +43,7 @@ elif type zoxide >/dev/null 2>&1; then
     fi
 else
     # rupa/z uses $_Z_DATA, jethrokuan/z (=port of z for fish) uses $Z_DATA
-    datafile="${_Z_DATA:-$Z_DATA}"
-    datafile="${datafile:-$HOME/.z}"
+    datafile="${_Z_DATA:-${Z_DATA:-$HOME/.z}}"
     if type fzf >/dev/null 2>&1 && [ -f "$datafile" ]; then
         # Read the data from z's file instead of calling
         # z so the data doesn't need to be processed twice