Skip to content

Commit

Permalink
Updated the test string to include escaped single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Sep 25, 2023
1 parent 611663b commit ab47c41
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CONSTRUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
4 changes: 2 additions & 2 deletions examples/scripts/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions examples/scripts/post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/scripts/pre_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab47c41

Please sign in to comment.