[Bash-completion-commits] [SCM] bash-completion branch, master, updated. f9f49786ca0f37fd89e794ebdc0f3c6c52ef09a5

Ville Skyttä ville.skytta at iki.fi
Wed Apr 21 20:21:00 UTC 2010


The following commit has been merged in the master branch:
commit f9f49786ca0f37fd89e794ebdc0f3c6c52ef09a5
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Apr 21 23:19:34 2010 +0300

    Fix running test scripts without giving a path to them.
    
    For example "cd test ; bash runCompletion [...]".

diff --git a/test/run b/test/run
index cdb1145..71a8712 100755
--- a/test/run
+++ b/test/run
@@ -31,7 +31,7 @@ set_tool() {
 }
 
 
-cd "${BASH_SOURCE[0]%/*}"
+cd "$(dirname "${BASH_SOURCE[0]}")"
 
 
 # Loop over the arguments.
diff --git a/test/runCompletion b/test/runCompletion
index 01af7e6..97f5412 100755
--- a/test/runCompletion
+++ b/test/runCompletion
@@ -4,4 +4,4 @@
 #       isn't initialized at that point (i.e. output of `expect' is shown on
 #       stdout - `open_logs' hasn't run yet?).  And running code from a library
 #       file isn't probably a good idea either.
-"$BASH" "${BASH_SOURCE[0]%/*}/run" --tool completion $*
+"$BASH" "$(dirname "${BASH_SOURCE[0]}")/run" --tool completion $*
diff --git a/test/runUnit b/test/runUnit
index 597342d..9ce71ef 100755
--- a/test/runUnit
+++ b/test/runUnit
@@ -4,4 +4,4 @@
 #       isn't initialized at that point (i.e. output of `expect' is shown on
 #       stdout - `open_logs' hasn't run yet?).  And running code from a library
 #       file isn't probably a good idea either.
-"$BASH" "${BASH_SOURCE[0]%/*}/run" --tool unit $*
+"$BASH" "$(dirname "${BASH_SOURCE[0]}")/run" --tool unit $*

-- 
bash-completion



More information about the Bash-completion-commits mailing list