aboutsummaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh19
1 files changed, 11 insertions, 8 deletions
diff --git a/run.sh b/run.sh
index e2c54c8..c06feed 100755
--- a/run.sh
+++ b/run.sh
@@ -10,6 +10,9 @@ while getopts "al" opt; do
;;
l) list_runs=1
;;
+ *) echo invalid args
+ exit
+ ;;
esac
done
@@ -17,12 +20,12 @@ shift $((OPTIND-1))
[ "${1:-}" = "--" ] && shift
-script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+script_dir="$( cd "$( dirname "$0" )" || exit > /dev/null && pwd )"
-runs_dir="$(find $script_dir/runs -mindepth 1 -maxdepth 1 -type f -executable)"
-runs_dir_all="$(find $script_dir/runs-all -mindepth 1 -maxdepth 1 -type f -executable)"
+runs_dir="$(find "$script_dir/runs" -mindepth 1 -maxdepth 1 -type f -executable)"
+runs_dir_all="$(find "$script_dir/runs-all" -mindepth 1 -maxdepth 1 -type f -executable)"
-if [ $list_runs == 1 ]; then
+if [ $list_runs = 1 ]; then
printf " runs --------------\n"
ls "$script_dir/runs"
printf "\n runs-all ----------\n"
@@ -33,18 +36,18 @@ fi
if [ "$1" != "" ]; then
[ -e "$script_dir/runs/$1.sh" ] && . "$script_dir/runs/$1.sh"
- if [ $run_runs_all == 1 ]; then
+ if [ $run_runs_all = 1 ]; then
. "$script_dir/runs-all/$1.sh"
fi
else
for s in $runs_dir; do
- echo running $s
+ echo "running $s"
. "$s"
done
- if [ $run_runs_all == 1 ]; then
+ if [ $run_runs_all = 1 ]; then
for s in $runs_dir_all; do
- echo running $s
+ echo "running $s"
. "$s"
done
fi