summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-04-09 16:36:09 +0200
committerhut <hut@lepus.uberspace.de>2015-04-09 16:36:09 +0200
commite01be7133607697331b82d35476ac6131e110e1a (patch)
tree2af796b3049b3cc672af579c6a97f2871d5d5585
parent05eb02687f8d06fd5c334f11e21a44bd3243bbba (diff)
parente2393938bf56f2bd6b93ea11e9282cf6d40a2514 (diff)
downloadranger-e01be7133607697331b82d35476ac6131e110e1a.tar.gz
Merge branch 'feature/fix-embedded-shell' of git://github.com/eiiches/ranger
-rwxr-xr-xranger.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger.py b/ranger.py
index 4b2e7daa..1d7e42e1 100755
--- a/ranger.py
+++ b/ranger.py
@@ -9,7 +9,7 @@
 # default is simply "ranger". (Not this file itself!)
 # The other arguments are passed to ranger.
 """":
-tempfile='/tmp/chosendir'
+tempfile="$(mktemp)"
 ranger="${1:-ranger}"
 test -z "$1" || shift
 "$ranger" --choosedir="$tempfile" "${@:-$(pwd)}"
@@ -17,8 +17,8 @@ returnvalue=$?
 test -f "$tempfile" &&
 if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
     cd "$(cat "$tempfile")"
-    rm -f -- "$tempfile"
 fi
+rm -f -- "$tempfile"
 return $returnvalue
 """ and None