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 22
22
23
23
#! /bin/bash
24
24
ERRORS_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"
27
26
28
27
if [ ! -f " $CONFIG_FILE " ]; then
29
28
ERROR_CODE=" 0108"
@@ -33,14 +32,15 @@ if [ ! -f "$CONFIG_FILE" ]; then
33
32
exit 1
34
33
fi
35
34
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
38
37
ERROR_MESSAGE=$( jq -r ' .["run.sh"][] | select(.code=="0109") | .message' " $ERRORS_FILE " )
39
38
ERROR_CODE=" 0109"
40
39
ERROR_LINK=$( jq -r ' .["run.sh"][] | select(.code=="0109") | .link' " $ERRORS_FILE " )
41
40
echo " Error $ERROR_CODE : $ERROR_MESSAGE $ERROR_LINK "
42
41
exit 1
43
42
fi
43
+ echo " Parsed CONFIG_JSON: $CONFIG_JSON " # debug
44
44
45
45
if [ -z " $( echo " $CONFIG_JSON " | jq -r ' .module.exports' ) " ]; then
46
46
ERROR_MESSAGE=$( jq -r ' .["run.sh"][] | select(.code=="0112") | .message' " $ERRORS_FILE " )
69
69
70
70
if [ " $TYPE " == " postprocessor" ]; then
71
71
bash " $GITHUB_ACTION_PATH /src/postprocessor.sh"
72
- fi
72
+ fi
You can’t perform that action at this time.
0 commit comments