aboutsummaryrefslogtreecommitdiff
path: root/ltask
diff options
context:
space:
mode:
Diffstat (limited to 'ltask')
-rwxr-xr-xltask14
1 files changed, 10 insertions, 4 deletions
diff --git a/ltask b/ltask
index 4716c63..bb82507 100755
--- a/ltask
+++ b/ltask
@@ -25,11 +25,8 @@ unset DIRNAME
[ ! -f ./$(basename $0) ] && echo "Could not find working directory" && exit 1
-readonly BASEDIR=$(pwd)
+BASEDIR=$(pwd)
-export readonly TASK_DIR=$BASEDIR/tasks
-export readonly ASSET_DIR=$BASEDIR/assets
-export readonly TARGET_DIR=$BASEDIR/targets
export readonly TOOL_DIR=$BASEDIR/tools
export readonly INCLUDE_DIR=$BASEDIR/libs
@@ -77,6 +74,7 @@ Options:
a custom target
-p Force parallel execution
-h print this help text
+ -d DIR specify a different folder containing "tasks", "targets", and "assets"
EOF
exit $1
}
@@ -99,6 +97,9 @@ for (( i=0; i < $ARGC;i++ )); do
PARALLEL="yes";;
-h)
print_help 0;;
+ -d)
+ i=$((i+1))
+ BASEDIR="${ARGV[$i]}";;
*)
echo Invalid Argument ${ARGV[$i]}
echo $0 -h for help
@@ -106,6 +107,11 @@ for (( i=0; i < $ARGC;i++ )); do
esac
done
+# Set after BASEDIR might have been changed
+export readonly TASK_DIR=$BASEDIR/tasks
+export readonly ASSET_DIR=$BASEDIR/assets
+export readonly TARGET_DIR=$BASEDIR/targets
+
if [ -z $TASK ]; then
TASK_LIST=( $(ls $TASK_DIR) )
TARGET_LIST=( $(ls $TARGET_DIR) )