Skip to content

Commit addb388

Browse files
committed
grid_submit.sh : Better error avoidance/handling
1 parent 8e214ec commit addb388

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

GRID/utils/grid_submit.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ export CONTROLSERVER
230230
export PRODSPLIT
231231
[[ $PRODSPLIT -gt 100 ]] && echo "Production split needs to be smaller than 100 for the moment" && exit 1
232232

233+
# check for presence of jq (needed in code path to fetch output files)
234+
[[ "$FETCHOUTPUT" ]] && { which jq &> /dev/null || { echo "Could not find jq command. Please load or install" && exit 1; }; }
235+
236+
# check if script is actually a valid file and fail early if not
237+
[[ "${SCRIPT}" ]] && [[ ! -f "${SCRIPT}" ]] && echo "Script file ${SCRIPT} does not exist .. aborting" && exit 1
238+
233239
# analyse options:
234240
# we should either run with --script or with -c
235241
[ "${SCRIPT}" ] && [ "$CONTINUE_WORKDIR" ] && echo "Script and continue mode not possible at same time" && exit 1

0 commit comments

Comments
 (0)