File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 11samples/helloworld
2+ samples/non_directory_task
23samples/no_undo
34samples/failingtask
Original file line number Diff line number Diff line change @@ -39,13 +39,14 @@ provision() {
3939 continue
4040 fi
4141
42- if [ ! -d $ZDSP_TASK_DIR /$task ]; then
43- fatal " task directory $ZDSP_TASK_DIR /$task not found"
42+ if [ -d $ZDSP_TASK_DIR /$task ]; then
43+ if [ ! -f $ZDSP_TASK_DIR /$task /do.sh ]; then
44+ fatal " task file $ZDSP_TASK_DIR /$task /do.sh not found"
45+ fi
46+ elif [ ! -f $ZDSP_TASK_DIR /$task ]; then
47+ fatal " task file $ZDSP_TASK_DIR /$task not found"
4448 fi
4549
46- if [ ! -f $ZDSP_TASK_DIR /$task /do.sh ]; then
47- fatal " task file $ZDSP_TASK_DIR /$task /do.sh not found"
48- fi
4950 done
5051
5152 info " Running tasks"
@@ -73,8 +74,14 @@ provision() {
7374 provision ` echo $task | sed s/^provision://g `
7475 fi
7576
76- sed -i $' s/\r $//' $ZDSP_TASK_DIR /$task /do.sh
77- bash $ZDSP_TASK_DIR /$task /do.sh
77+ if [ -f $ZDSP_TASK_DIR /$task ]; then
78+ scriptfile=$ZDSP_TASK_DIR /$task
79+ else
80+ scriptfile=$ZDSP_TASK_DIR /$task /do.sh
81+ fi
82+
83+ sed -i $' s/\r $//' $scriptfile
84+ bash $scriptfile
7885 if [ $? != 0 ]; then
7986 error " task $task failed. Rolling back."
8087 for task in ` tac $ZDSP_CONFIG_DIR /$config | tail -n $num ` ; do
Original file line number Diff line number Diff line change 1+ echo "This is a non-directory task"
You can’t perform that action at this time.
0 commit comments