@@ -27,13 +27,13 @@ CONFIG_DATA="just.config.json"
27
27
source $GITHUB_ACTION_PATH /src/modules/errmsg.sh
28
28
29
29
VERSION=$( echo " $GITHUB_ACTION_PATH " | grep -oP ' (?<=/v)[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?' )
30
- msg1=( $( _justMessage " Running Just an Ultimate Site Tool v$VERSION " ) )
31
- msg2=( $( _justMessage " Installing Node.js" ) )
32
- msg3=( $( _justMessage " Installed Node.js" ) )
33
- msg4=( $( _justMessage " Postprocessing completed" ) )
34
- msg5=( $( _justMessage " Generating completed" ) )
35
- msg6=( $( _justMessage " Compressing completed" ) )
36
- msg7=( $( _justMessage " Generating completed" ) )
30
+ msg1=$( _justMessage " Running Just an Ultimate Site Tool v$VERSION " )
31
+ msg2=$( _justMessage " Installing Node.js" )
32
+ msg3=$( _justMessage " Installed Node.js" )
33
+ msg4=$( _justMessage " Postprocessing completed" )
34
+ msg5=$( _justMessage " Generating completed" )
35
+ msg6=$( _justMessage " Compressing completed" )
36
+ msg7=$( _justMessage " Generating completed" )
37
37
echo " $msg1 "
38
38
39
39
installNodejs () {
@@ -49,47 +49,47 @@ installNodejs() {
49
49
}
50
50
51
51
if [ -f " $CONFIG_DATA " ]; then
52
- local ERROR_MESSAGE=( $( ErrorMessage " run.sh" " 0113" ) )
53
- echo $ERROR_MESSAGE && exit 1
52
+ local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0113" )
53
+ echo " $ERROR_MESSAGE " && exit 1
54
54
fi
55
55
56
56
if [ ! -f " $CONFIG_FILE " ]; then
57
- local ERROR_MESSAGE=( $( ErrorMessage " run.sh" " 0108" ) )
58
- echo $ERROR_MESSAGE && exit 1
57
+ local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0108" )
58
+ echo " $ERROR_MESSAGE " && exit 1
59
59
fi
60
60
61
61
CONFIG_JSON=$( node -e " console.log(JSON.stringify(require('./just.config.js')));" )
62
62
if [ $? -ne 0 ]; then
63
- local ERROR_MESSAGE=( $( ErrorMessage " run.sh" " 0109" ) )
64
- echo $ERROR_MESSAGE && exit 1
63
+ local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0109" )
64
+ echo " $ERROR_MESSAGE " && exit 1
65
65
fi
66
66
echo " Parsed just.config.js module.exports: $CONFIG_JSON " # debug
67
67
echo " $CONFIG_JSON " > " $CONFIG_DATA "
68
68
69
69
if [ -z " $( echo " $CONFIG_JSON " | jq -r ' .module.exports' ) " ]; then
70
- local ERROR_MESSAGE=( $( ErrorMessage " run.sh" " 0112" ) )
71
- echo $ERROR_MESSAGE && exit 1
70
+ local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0112" )
71
+ echo " $ERROR_MESSAGE " && exit 1
72
72
fi
73
73
74
74
TYPE=$( echo " $CONFIG_JSON " | jq -r ' .type' )
75
75
if [ -z " $TYPE " ]; then
76
- local ERROR_MESSAGE=( $( ErrorMessage " run.sh" " 0110" ) )
77
- echo $ERROR_MESSAGE && exit 1
76
+ local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0110" )
77
+ echo " $ERROR_MESSAGE " && exit 1
78
78
fi
79
79
80
80
if [[ " $TYPE " != " postprocessor" && " $TYPE " != " redirector" && " $TYPE " != " compressor" && " $TYPE " != " generator" ]]; then
81
- local ERROR_MESSAGE=( $( ErrorMessage " run.sh" " 0111" ) )
82
- echo $ERROR_MESSAGE && exit 1
81
+ local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0111" )
82
+ echo " $ERROR_MESSAGE " && exit 1
83
83
fi
84
84
85
85
if [ " $TYPE " != " compressor" ]; then
86
86
if [ -d " deploy" ]; then
87
- local ERROR_MESSAGE=( $( ErrorMessage " important_dirs" " 0106" ) )
88
- echo $ERROR_MESSAGE && exit 1
87
+ local ERROR_MESSAGE=$( ErrorMessage " important_dirs" " 0106" )
88
+ echo " $ERROR_MESSAGE " && exit 1
89
89
fi
90
90
if [ -d " _just_data" ]; then
91
- local ERROR_MESSAGE=( $( ErrorMessage " important_dirs" " 0107" ) )
92
- echo $ERROR_MESSAGE && exit 1
91
+ local ERROR_MESSAGE=$( ErrorMessage " important_dirs" " 0107" )
92
+ echo " $ERROR_MESSAGE " && exit 1
93
93
fi
94
94
mkdir -p deploy
95
95
mkdir -p _just_data
@@ -100,11 +100,11 @@ if [ "$TYPE" == "postprocessor" ]; then
100
100
postprocessor_checks=$( bash $GITHUB_ACTION_PATH /src/postprocessor/checks.sh 2>&1 ) || {
101
101
local error_code=$?
102
102
if [ $error_code -eq 1 ]; then
103
- local ERROR_MESSAGE=( $( ErrorMessage " postprocessor/checks.sh" " 0100" " $postprocessor_checks " ) )
103
+ local ERROR_MESSAGE=$( ErrorMessage " postprocessor/checks.sh" " 0100" " $postprocessor_checks " )
104
104
if [ " $postprocessor_checks " == " 0101" ]; then
105
- ERROR_MESSAGE=( $( ErrorMessage " postprocessor/checks.sh" " 0101" ) )
105
+ ERROR_MESSAGE=$( ErrorMessage " postprocessor/checks.sh" " 0101" )
106
106
fi
107
- echo $ERROR_MESSAGE && exit 1
107
+ echo " $ERROR_MESSAGE " && exit 1
108
108
fi
109
109
} && \
110
110
bash $GITHUB_ACTION_PATH /src/postprocessor/prepare_deployment.sh && \
0 commit comments