Skip to content

Commit af97813

Browse files
fix
1 parent 2f16b7d commit af97813

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/run.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
#!/bin/bash
2424
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"
2726

2827
if [ ! -f "$CONFIG_FILE" ]; then
2928
ERROR_CODE="0108"
@@ -33,14 +32,15 @@ if [ ! -f "$CONFIG_FILE" ]; then
3332
exit 1
3433
fi
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
4342
fi
43+
echo "Parsed CONFIG_JSON: $CONFIG_JSON" # debug
4444

4545
if [ -z "$(echo "$CONFIG_JSON" | jq -r '.module.exports')" ]; then
4646
ERROR_MESSAGE=$(jq -r '.["run.sh"][] | select(.code=="0112") | .message' "$ERRORS_FILE")
@@ -69,4 +69,4 @@ fi
6969

7070
if [ "$TYPE" == "postprocessor" ]; then
7171
bash "$GITHUB_ACTION_PATH/src/postprocessor.sh"
72-
fi
72+
fi

0 commit comments

Comments
 (0)