File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 2222
2323#! /bin/bash
2424ERRORS_FILE=" $GITHUB_ACTION_PATH /data/codes.json"
25- CONFIG_JSON=$( node -e " console.log(JSON.stringify(require('./just.config.js')));" )
26- echo " Parsed CONFIG_JSON: $CONFIG_JSON " # debug
25+ CONFIG_FILE=" just.config.js"
2726
2827if [ ! -f " $CONFIG_FILE " ]; then
2928 ERROR_CODE=" 0108"
@@ -33,14 +32,15 @@ if [ ! -f "$CONFIG_FILE" ]; then
3332 exit 1
3433fi
3534
36- CONFIG_CONTENT =$( cat " $CONFIG_FILE " )
37- if ! CONFIG_JSON= $( echo " $CONFIG_CONTENT " | node -e " console.log(JSON.stringify(eval('(' + process.stdin.read() + ')'))); " ) ; then
35+ CONFIG_JSON =$( node -e " console.log(JSON.stringify(require('./just.config.js'))); " )
36+ if [ $? -ne 0 ] ; then
3837 ERROR_MESSAGE=$( jq -r ' .["run.sh"][] | select(.code=="0109") | .message' " $ERRORS_FILE " )
3938 ERROR_CODE=" 0109"
4039 ERROR_LINK=$( jq -r ' .["run.sh"][] | select(.code=="0109") | .link' " $ERRORS_FILE " )
4140 echo " Error $ERROR_CODE : $ERROR_MESSAGE $ERROR_LINK "
4241 exit 1
4342fi
43+ echo " Parsed CONFIG_JSON: $CONFIG_JSON " # debug
4444
4545if [ -z " $( echo " $CONFIG_JSON " | jq -r ' .module.exports' ) " ]; then
4646 ERROR_MESSAGE=$( jq -r ' .["run.sh"][] | select(.code=="0112") | .message' " $ERRORS_FILE " )
6969
7070if [ " $TYPE " == " postprocessor" ]; then
7171 bash " $GITHUB_ACTION_PATH /src/postprocessor.sh"
72- fi
72+ fi
You can’t perform that action at this time.
0 commit comments