properly set permissions and delete tmp file

This commit is contained in:
Jorge Morante 2016-04-30 01:03:45 +02:00
parent f3d392f63d
commit b822109b31
2 changed files with 5 additions and 3 deletions

View File

@ -6,6 +6,7 @@ source $DIRNAME/config.sh
#TODO move this out of here!
current_pane_id=$1
fingers_pane_id=$2
tmp_path=$3
ALPHABET=asdfqwertjkluiop
ALPHABET_SIZE=${#ALPHABET}
@ -56,6 +57,7 @@ echo -ne "$output"
function handle_exit() {
tmux swap-pane -s $current_pane_id -t $fingers_pane_id
tmux kill-pane -t $fingers_pane_id
rm -rf $tmp_path
}
trap "handle_exit" EXIT

View File

@ -41,15 +41,15 @@ function prompt_fingers_for_pane() {
local current_pane_id=$1
local fingers_pane_id=`init_fingers_pane`
local tmp_path=`mktemp --suffix "tmux-fingers"`
chmod 600 "$tmp_path"
wait
capture_pane "$current_pane_id" "$tmp_path"
pane_exec $fingers_pane_id "cat $tmp_path | $CURRENT_DIR/fingers.sh $current_pane_id $fingers_pane_id"
pane_exec $fingers_pane_id "cat $tmp_path | $CURRENT_DIR/fingers.sh $current_pane_id $fingers_pane_id $tmp_path"
tmux swap-pane -s $current_pane_id -t $fingers_pane_id
##rm $tmp_path
echo $fingers_pane_id
}