Skip to content

Commit e6c7ec8

Browse files
Update run.sh
1 parent 850a19a commit e6c7ec8

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/run.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ msg6=$(_justMessage "$_GREEN Compressing completed$_RESET")
4545
msg9=$(_justMessage "$_GREEN Generating completed$_RESET")
4646
echo -e "$msg1"
4747

48+
chmod +x "$GITHUB_ACTION_PATH/src/time.py" # use python to get current time in ms cuz yes
49+
TIME0=$(python3 "$GITHUB_ACTION_PATH/src/time.py")
4850
installNodejs() {
4951
echo -e "$msg2"
50-
chmod +x "$GITHUB_ACTION_PATH/src/time.py" # use python to get current time in ms cuz yes
5152
local TIME1=$(python3 "$GITHUB_ACTION_PATH/src/time.py")
5253
if ! command -v node > /dev/null; then # attempt 0: nodejs installed before running _just
5354
# attempt 1: install via curl
@@ -173,18 +174,24 @@ if [ "$TYPE" == "postprocessor" ]; then
173174
installNodejs && \
174175
node $GITHUB_ACTION_PATH/src/compress.js "deploy" && \
175176
bash $GITHUB_ACTION_PATH/src/postprocessor/build_map.sh && \
176-
echo -e "$msg4"
177+
TIME3=$(python3 "$GITHUB_ACTION_PATH/src/time.py") && \
178+
DONEIN=$(node "$GITHUB_ACTION_PATH/src/time.js" "$TIME0" "$TIME3") && \
179+
echo -e "$msg4 ($DONEIN)"
177180
elif [ "$TYPE" == "redirect" ]; then
178181
mkdir -p deploy/_just && \
179182
installNodejs && \
180183
bash $GITHUB_ACTION_PATH/src/redirect/checks.sh && \
181184
node $GITHUB_ACTION_PATH/src/redirect/index.js && \
182-
echo -e "$msg5"
185+
TIME3=$(python3 "$GITHUB_ACTION_PATH/src/time.py") && \
186+
DONEIN=$(node "$GITHUB_ACTION_PATH/src/time.js" "$TIME0" "$TIME3") && \
187+
echo -e "$msg5 ($DONEIN)"
183188
elif [ "$TYPE" == "compress" ]; then
184189
mkdir -p deploy && \
185190
installNodejs && \
186191
node $GITHUB_ACTION_PATH/src/compress.js "$INPUT_PATH" && \
187-
echo -e "$msg6"
192+
TIME3=$(python3 "$GITHUB_ACTION_PATH/src/time.py") && \
193+
DONEIN=$(node "$GITHUB_ACTION_PATH/src/time.js" "$TIME0" "$TIME3") && \
194+
echo -e "$msg6 ($DONEIN)"
188195
elif [ "$TYPE" == "docs" ]; then
189196
HTML=$(cat "$GITHUB_ACTION_PATH/src/documentation/templates/page.html") && \
190197
CSS=$(cat "$GITHUB_ACTION_PATH/src/documentation/templates/base.css") && \
@@ -222,5 +229,7 @@ elif [ "$TYPE" == "docs" ]; then
222229
node "$INDEXJS0" "$HTML" "$CSS" "$JS" "$INPUT_PATH" "$GITHUB_REPOSITORY" "$GITHUB_REPOSITORY_OWNER" "$CUSTOMCSS" "$HLJSLANGS" "$LANGS" "$HIGHLIGHTCSS" "$LANGSTEXT" "$VERSION" "$BUTTONSCSS" "$SEARCHCSS" "$HIGHLIGHTJSON" || jserr && \
223230
node $GITHUB_ACTION_PATH/src/compress.js "$INPUT_PATH" && \
224231
node "$GITHUB_ACTION_PATH/src/documentation/logs.js" "$INPUT_PATH" && \
225-
echo -e "$msg9"
232+
TIME3=$(python3 "$GITHUB_ACTION_PATH/src/time.py") && \
233+
DONEIN=$(node "$GITHUB_ACTION_PATH/src/time.js" "$TIME0" "$TIME3") && \
234+
echo -e "$msg9 ($DONEIN)"
226235
fi

0 commit comments

Comments
 (0)