diff options
author | hut <hut@lavabit.com> | 2010-01-11 23:33:38 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-11 23:33:38 +0100 |
commit | 4d6c426ff8d9d304fe97c17249fbfb3b93acf16d (patch) | |
tree | 87071229fcea70c001760607f91c97c1087781cf /ranger.py | |
parent | 5e4496993a297d0c7591084bd54f3df66d4ffe66 (diff) | |
download | ranger-4d6c426ff8d9d304fe97c17249fbfb3b93acf16d.tar.gz |
ranger.py: cleanup/fix
Diffstat (limited to 'ranger.py')
-rwxr-xr-x | ranger.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ranger.py b/ranger.py index d11b49d9..1dd7b86d 100755 --- a/ranger.py +++ b/ranger.py @@ -24,20 +24,19 @@ # source /path/ranger /path/ranger """": if [ $1 ]; then - trap "kill -2 %+" INT - - RANGER="$1" + ranger_exec="$1" shift - exec 3< <($RANGER --cd-after-exit $@ 3>&1 1>&2 2>&3 3>&-) - read NEWDIR <&3 - exec 3<&- + trap "kill -2 %+" INT + exec 3< <($ranger_exec --cd-after-exit $@ 3>&1 1>&2 2>&3 3>&-) - cd $NEWDIR + read ranger_output <&3 + cd "$ranger_output" + exec 3<&- trap - INT - unset RANGER - unset NEWDIR + unset ranger_exec + unset ranger_output else echo "usage: source path/to/ranger.py path/to/ranger.py" fi |