Skip to content

Commit df606c1

Browse files
committed
quote variables in shell conditionals
Fix incorrect evaluation of -n tests for CRC_BUNDLE, HTTP_PROXY, and HTTPS_PROXY variables. Without quotes, the test evaluates to true even when variables are unset or empty, causing spurious error messages: ERRO Please provide a configuration property and its value as in 'crc config set KEY VALUE' Quote the variables in conditional expressions so that -n correctly evaluates to false for empty or unset values.
1 parent fd2fbf4 commit df606c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

devsetup/scripts/crc-setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ ${CRC_BIN} config set skip-check-daemon-systemd-sockets true
5353
${CRC_BIN} config set cpus ${CPUS}
5454
${CRC_BIN} config set memory ${MEMORY}
5555
${CRC_BIN} config set disk-size ${DISK}
56-
if [ -n ${HTTP_PROXY} ]; then
56+
if [ -n "${HTTP_PROXY}" ]; then
5757
${CRC_BIN} config set http-proxy ${HTTP_PROXY}
5858
fi
59-
if [ -n ${HTTPS_PROXY} ]; then
59+
if [ -n "${HTTPS_PROXY}" ]; then
6060
${CRC_BIN} config set https-proxy ${HTTPS_PROXY}
6161
fi
62-
if [ -n ${CRC_BUNDLE} ]; then
62+
if [ -n "${CRC_BUNDLE}" ]; then
6363
${CRC_BIN} config set bundle ${CRC_BUNDLE}
6464
fi
6565
if [ "$CRC_MONITORING_ENABLED" = "true" ]; then

0 commit comments

Comments
 (0)