Skip to content

Commit f905b6e

Browse files
fix
1 parent a416b2e commit f905b6e

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

src/documentation/checks.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ config=$(cat just.config.json)
2626

2727
docs_config=$(echo "$config" | jq -r '.docs_config')
2828
if ! echo "$config" | jq -e '.docs_config' > /dev/null; then
29-
local ERROR_MESSAGE=($(ErrorMessage "docs/checks.sh" "0118"))
30-
echo $ERROR_MESSAGE && exit 1
29+
local ERROR_MESSAGE=$(ErrorMessage "docs/checks.sh" "0118")
30+
echo "$ERROR_MESSAGE" && exit 1
3131
fi
3232

3333
validate_docs_config() {
3434
local metatitle=$(echo "$config" | jq -r '.docs_config.metatitle' > /dev/null)
3535
if [[ -z "$metatitle" ]]; then
36-
local ERROR_MESSAGE=($(ErrorMessage "docs/checks.sh" "0119"))
37-
echo $ERROR_MESSAGE && exit 1
36+
local ERROR_MESSAGE=$(ErrorMessage "docs/checks.sh" "0119")
37+
echo "$ERROR_MESSAGE" && exit 1
3838
fi
3939
local domain=$(echo "$config" | jq -r '.docs_config.domain' > /dev/null)
4040
if [[ -z "$domain" ]]; then
41-
local ERROR_MESSAGE=($(ErrorMessage "docs/checks.sh" "0120"))
42-
echo $ERROR_MESSAGE && exit 1
41+
local ERROR_MESSAGE=$(ErrorMessage "docs/checks.sh" "0120")
42+
echo "$ERROR_MESSAGE" && exit 1
4343
fi
4444
}
4545

src/run.sh

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ CONFIG_DATA="just.config.json"
2727
source $GITHUB_ACTION_PATH/src/modules/errmsg.sh
2828

2929
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")
3737
echo "$msg1"
3838

3939
installNodejs() {
@@ -49,47 +49,47 @@ installNodejs() {
4949
}
5050

5151
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
5454
fi
5555

5656
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
5959
fi
6060

6161
CONFIG_JSON=$(node -e "console.log(JSON.stringify(require('./just.config.js')));")
6262
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
6565
fi
6666
echo "Parsed just.config.js module.exports: $CONFIG_JSON" # debug
6767
echo "$CONFIG_JSON" > "$CONFIG_DATA"
6868

6969
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
7272
fi
7373

7474
TYPE=$(echo "$CONFIG_JSON" | jq -r '.type')
7575
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
7878
fi
7979

8080
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
8383
fi
8484

8585
if [ "$TYPE" != "compressor" ]; then
8686
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
8989
fi
9090
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
9393
fi
9494
mkdir -p deploy
9595
mkdir -p _just_data
@@ -100,11 +100,11 @@ if [ "$TYPE" == "postprocessor" ]; then
100100
postprocessor_checks=$(bash $GITHUB_ACTION_PATH/src/postprocessor/checks.sh 2>&1) || {
101101
local error_code=$?
102102
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")
104104
if [ "$postprocessor_checks" == "0101" ]; then
105-
ERROR_MESSAGE=($(ErrorMessage "postprocessor/checks.sh" "0101"))
105+
ERROR_MESSAGE=$(ErrorMessage "postprocessor/checks.sh" "0101")
106106
fi
107-
echo $ERROR_MESSAGE && exit 1
107+
echo "$ERROR_MESSAGE" && exit 1
108108
fi
109109
} && \
110110
bash $GITHUB_ACTION_PATH/src/postprocessor/prepare_deployment.sh && \

0 commit comments

Comments
 (0)