make --message conditional

This commit is contained in:
Muhammad Atif Ali 2023-08-11 13:12:37 +03:00
parent 1f99dff337
commit 8be7894259

View file

@ -12,7 +12,13 @@ echo "CODER_TEMPLATE_ID: ${CODER_TEMPLATE_ID}"
echo "CODER_TEMPLATE_DIR: ${CODER_TEMPLATE_DIR}"
# Construct push command
push_command="coder templates push ${CODER_TEMPLATE_ID} --directory ./${CODER_TEMPLATE_DIR}" --message ${CODER_TEMPLATE_MESSAGE}
push_command="coder templates push ${CODER_TEMPLATE_ID} --directory ./${CODER_TEMPLATE_DIR}"
# Add message to the push command if specified
if [ -n "${CODER_TEMPLATE_MESSAGE}" ]; then
push_command+=" --message ${CODER_TEMPLATE_MESSAGE}"
fi
push_command+=" --message ${CODER_TEMPLATE_MESSAGE}"
# Append --create flag to the push command if CODER_TEMPLATE_CREATE is true
if [ "${CODER_TEMPLATE_CREATE}" = "true" ]; then