Skip to content

Commit 0759bbc

Browse files
author
Gary Lockett
authored
Merge pull request #123 from internalsystemerror/1.24.x
Ensure `BEFORE_SCRIPT` and `AFTER_SCRIPT` are populated correctly
2 parents 7a6722b + f115f97 commit 0759bbc

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

entrypoint.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,10 @@ if [[ "${PHP}" == "" ]];then
142142
fi
143143

144144
declare -a BEFORE_SCRIPT=()
145-
BEFORE_SCRIPT_STRING="$(echo "${JOB}" | jq -rc '(.before_script // [])[]' | tr -d '\n')"
146-
if [[ "${BEFORE_SCRIPT_STRING}" != "" ]]; then
147-
readarray -t BEFORE_SCRIPT="${BEFORE_SCRIPT_STRING}"
148-
fi
145+
readarray -t BEFORE_SCRIPT < <(echo "${JOB}" | jq -rc '(.before_script // [])[]' )
149146

150147
declare -a AFTER_SCRIPT=()
151-
AFTER_SCRIPT_STRING="$(echo "${JOB}" | jq -rc '(.after_script // [])[]' | tr -d '\n')"
152-
if [[ "${AFTER_SCRIPT_STRING}" != "" ]]; then
153-
readarray -t AFTER_SCRIPT="${AFTER_SCRIPT_STRING}"
154-
fi
148+
readarray -t AFTER_SCRIPT < <(echo "${JOB}" | jq -rc '(.after_script // [])[]' )
155149

156150

157151
echo "Marking PHP ${PHP} as configured default"

0 commit comments

Comments
 (0)