diff --git a/CONSTRUCT.md b/CONSTRUCT.md index 0666534f6..2d9b45baa 100644 --- a/CONSTRUCT.md +++ b/CONSTRUCT.md @@ -458,7 +458,9 @@ On Unix the variable values are automatically single quoted, allowing you to supply strings with spaces, without needing to worry about escaping. As a consequence, string interpolation is disabled: if you need string interpolation, you can apply it in the -pre_install/post_install script(s). +pre_install/post_install script(s). If you need to include single quotes +in your value, you can escape them by replacing each single quote with +`'\''`. ### `pre_uninstall` diff --git a/examples/scripts/construct.yaml b/examples/scripts/construct.yaml index 4908198b2..db70bd15e 100644 --- a/examples/scripts/construct.yaml +++ b/examples/scripts/construct.yaml @@ -7,8 +7,8 @@ specs: - python script_env_variables: - CUSTOM_VARIABLE_1: FIR$T CUSTOM STRING WITH SPACES AND @*#! "CHARACTERS" - CUSTOM_VARIABLE_2: $ECOND CUSTOM STRING WITH SPACES AND @*#! "CHARACTERS" + CUSTOM_VARIABLE_1: FIR$T CUSTOM '\''STRING'\'' WITH SPACES AND @*#! "CHARACTERS" + CUSTOM_VARIABLE_2: $ECOND CUSTOM '\''STRING'\'' WITH SPACES AND @*#! "CHARACTERS" pre_install: pre_install.sh # [unix] pre_install: pre_install.bat # [win] diff --git a/examples/scripts/post_install.sh b/examples/scripts/post_install.sh index 5f6e73786..0495b08ef 100644 --- a/examples/scripts/post_install.sh +++ b/examples/scripts/post_install.sh @@ -15,8 +15,8 @@ echo "PREFIX=${PREFIX}" test "${INSTALLER_NAME}" = "Scripts" test "${INSTALLER_VER}" = "X" -test "${CUSTOM_VARIABLE_1}" = 'FIR$T CUSTOM STRING WITH SPACES AND @*#! "CHARACTERS"' -test "${CUSTOM_VARIABLE_2}" = '$ECOND CUSTOM STRING WITH SPACES AND @*#! "CHARACTERS"' +test "${CUSTOM_VARIABLE_1}" = 'FIR$T CUSTOM '\''STRING'\'' WITH SPACES AND @*#! "CHARACTERS"' +test "${CUSTOM_VARIABLE_2}" = '$ECOND CUSTOM '\''STRING'\'' WITH SPACES AND @*#! "CHARACTERS"' if [[ $(uname -s) == Linux ]]; then if [[ ${INSTALLER_PLAT} != linux-* ]]; then diff --git a/examples/scripts/pre_install.sh b/examples/scripts/pre_install.sh index f4d41ce13..f164efdfc 100644 --- a/examples/scripts/pre_install.sh +++ b/examples/scripts/pre_install.sh @@ -12,8 +12,8 @@ echo "PREFIX=${PREFIX}" test "${INSTALLER_NAME}" = "Scripts" test "${INSTALLER_VER}" = "X" -test "${CUSTOM_VARIABLE_1}" = 'FIR$T CUSTOM STRING WITH SPACES AND @*#! "CHARACTERS"' -test "${CUSTOM_VARIABLE_2}" = '$ECOND CUSTOM STRING WITH SPACES AND @*#! "CHARACTERS"' +test "${CUSTOM_VARIABLE_1}" = 'FIR$T CUSTOM '\''STRING'\'' WITH SPACES AND @*#! "CHARACTERS"' +test "${CUSTOM_VARIABLE_2}" = '$ECOND CUSTOM '\''STRING'\'' WITH SPACES AND @*#! "CHARACTERS"' if [[ $(uname -s) == Linux ]]; then if [[ ${INSTALLER_PLAT} != linux-* ]]; then