From f743769912e1824cced1bcb5cafd2600abb3d138 Mon Sep 17 00:00:00 2001 From: vonavi Date: Wed, 2 Oct 2013 09:26:11 +0300 Subject: [PATCH] Allow to execute `tour_parse' from different directories. --- tour-parse | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tour-parse b/tour-parse index 7d8b056..84ef7ab 100755 --- a/tour-parse +++ b/tour-parse @@ -8,6 +8,8 @@ white='(.+)' black='(.+)' result='((1|0|0\.5):(1|0|0\.5))' +script_path=`dirname $0` + # Directories to search `tour_info' in if [[ $# != 0 ]]; then tour_dirs=() @@ -16,10 +18,10 @@ if [[ $# != 0 ]]; then number=0"$number" number=${number:(-2)} - tour_dirs+=($tournament/tour_$number) + tour_dirs+=($script_path/$tournament/tour_$number) done else - tour_dirs=($tournament/tour_*) + tour_dirs=($script_path/$tournament/tour_*) fi for dir in "${tour_dirs[@]}"; do