From 8fb03380d517dfa75e3c7fcf7218999744386745 Mon Sep 17 00:00:00 2001 From: Jorge Morante Date: Sun, 1 May 2016 19:01:28 +0200 Subject: [PATCH] mini cleanup --- scripts/config.sh | 4 ++-- scripts/debug.sh | 7 +++++-- scripts/fingers.sh | 1 - scripts/utils.sh | 5 ----- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/config.sh b/scripts/config.sh index 19256df..da44e67 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -1,6 +1,6 @@ #!/bin/bash -DIRNAME="$(dirname "$0")" +CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function check_pattern() { echo "beep beep" | grep -e "$1" 2> /dev/null @@ -12,7 +12,7 @@ function check_pattern() { fi } -source "$DIRNAME/utils.sh" +source "$CURRENT_DIR/utils.sh" PATTERNS_LIST=( "((^|^\.|[[:space:]]|[[:space:]]\.|[[:space:]]\.\.|^\.\.)[[:alnum:]~_-]*/[][[:alnum:]_.#$%&+=/@-]*)" diff --git a/scripts/debug.sh b/scripts/debug.sh index eb8632d..4be5585 100755 --- a/scripts/debug.sh +++ b/scripts/debug.sh @@ -1,7 +1,10 @@ #!/bin/bash -DIRNAME="$(dirname "$0")" +# Source this file and call `tail -f fingers.log` when you don't know WTF is +# going on. + +CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function log() { - echo "$1" >> $DIRNAME/../fingers.log + echo "$1" >> "$DIRNAME/../fingers.log" } diff --git a/scripts/fingers.sh b/scripts/fingers.sh index 3694326..ec68314 100755 --- a/scripts/fingers.sh +++ b/scripts/fingers.sh @@ -62,7 +62,6 @@ do fi if [[ $(has_capitals $input) == "1" ]]; then - #TODO wtf spaces? tmux command-prompt -p "fingers-exec:" "run-shell -t $fingers_pane_id \"$CURRENT_DIR/exec.sh '%%' '$result' '${current_pane_id//%}' '${fingers_pane_id//%}'\"" else copy_result "$result" diff --git a/scripts/utils.sh b/scripts/utils.sh index fb79b24..ead4c9a 100755 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -4,10 +4,6 @@ function array_join() { local IFS="$1"; shift; echo "$*"; } -function array_concat() { - echo "$*" -} - function display_message() { local original_display_time=$(tmux show-option -gqv display-time) tmux set-option -g display-time $2 @@ -29,4 +25,3 @@ function pane_exec() { tmux send-keys -t $pane_id "$pane_command" tmux send-keys -t $pane_id Enter } -