From 89b0c60b69f341a954d898eab031330fb1e1679a Mon Sep 17 00:00:00 2001 From: Mark Blakeney Date: Sun, 19 Aug 2018 14:04:04 +1000 Subject: Remove hard code of ranger path Hard coding the path of ranger prohibits the bash_automatic_cd.sh script from working when the user has installed ranger in a different path such as in /usr/local/bin/, or ~/.local/bin/ etc. --- examples/bash_automatic_cd.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'examples/bash_automatic_cd.sh') diff --git a/examples/bash_automatic_cd.sh b/examples/bash_automatic_cd.sh index bdac5757..04b58e24 100644 --- a/examples/bash_automatic_cd.sh +++ b/examples/bash_automatic_cd.sh @@ -6,12 +6,10 @@ # the last visited one after ranger quits. # To undo the effect of this function, you can type "cd -" to return to the # original directory. -# -# On OS X 10 or later, replace `usr/bin/ranger` with `/usr/local/bin/ranger`. function ranger-cd { tempfile="$(mktemp -t tmp.XXXXXX)" - /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" + ranger --choosedir="$tempfile" "${@:-$(pwd)}" test -f "$tempfile" && if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then cd -- "$(cat "$tempfile")" -- cgit 1.4.1-2-gfad0