Skip to content

Commit bc52129

Browse files
committed
fix(fish): clean up variables
* use `status dirname` builtin to save 1 dirname call * use builtin test function instead of [ command * use local scoping for INSTALL_DIR variable (and make it lowercase to indicate such change) * remove $FORGIT as it's not needed anymore (we already set git-forgit alias) Ref: https://fishshell.com/docs/current/cmds/test.html
1 parent 4a59eed commit bc52129

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

conf.d/forgit.plugin.fish

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# MIT (c) Chris Apple
22

3-
set INSTALL_DIR (dirname (dirname (status -f)))
4-
set -x FORGIT_INSTALL_DIR "$INSTALL_DIR/conf.d"
5-
set -x FORGIT "$FORGIT_INSTALL_DIR/bin/git-forgit"
6-
if [ ! -e "$FORGIT" ]
7-
set -x FORGIT_INSTALL_DIR "$INSTALL_DIR/vendor_conf.d"
8-
set -x FORGIT "$FORGIT_INSTALL_DIR/bin/git-forgit"
3+
set -l install_dir (dirname (status dirname))
4+
set -x FORGIT_INSTALL_DIR "$install_dir/conf.d"
5+
if not test -e "$FORGIT_INSTALL_DIR/bin/git-forgit"
6+
set -x FORGIT_INSTALL_DIR "$install_dir/vendor_conf.d"
97
end
108

119
function forgit::warn

0 commit comments

Comments
 (0)