Limit message to fit in its area.
[rover.git] / rover.sh
blob82edf7c318b306f26e16040ca42b0960a863fa85
1 #!/bin/sh
3 # Based on ranger launcher.
5 # Usage: ". ./rover.sh [/path/to/rover]"
7 tempfile="$(mktemp 2> /dev/null || printf "/tmp/rover-cwd.%s" $$)"
8 if [ $# -gt 0 ]; then
9 rover="$1"
10 shift
11 else
12 rover="rover"
14 "$rover" --save-cwd "$tempfile" "$@"
15 returnvalue=$?
16 test -f "$tempfile" &&
17 if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
18 cd "$(cat "$tempfile")"
20 rm -f -- "$tempfile"
21 return $returnvalue