From 65cca2fde3a7fe72cd6a2d498bfd86c5ff4a9ba1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 12 Sep 2024 10:15:43 +0200 Subject: [PATCH] use double-quotes to make output more readable commit 766b70c5be1a000e09a159aedd0d2375dee84ded quoted these values to prevent globbing, but used single quotes. However, these commands are executed with `sh -c` using single quotes, which makes the output hard to read because of the embedded quotes being escaped. This patch changes to use double-quotes, which should still prevent globbing to happen, but make the output more readable. Before: CHANNEL=test ./install.sh ... Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo + '[' test '!=' stable ']' + sh -c 'dnf config-manager --set-disabled '\''docker-ce-*'\''' + sh -c 'dnf config-manager --set-enabled '\''docker-ce-test'\''' + sh -c 'dnf makecache' After: CHANNEL=test ./install.sh ... Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo + '[' test '!=' stable ']' + sh -c 'dnf config-manager --set-disabled "docker-ce-*"' + sh -c 'dnf config-manager --set-enabled "docker-ce-test"' + sh -c 'dnf makecache' Signed-off-by: Sebastiaan van Stijn --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index ff6c2a50..3350d695 100755 --- a/install.sh +++ b/install.sh @@ -569,8 +569,8 @@ do_install() { $sh_c "rm -f '${TMP_REPO_FILE}'" if [ "$CHANNEL" != "stable" ]; then - $sh_c "dnf5 config-manager setopt 'docker-ce-*.enabled=0'" - $sh_c "dnf5 config-manager setopt 'docker-ce-$CHANNEL.enabled=1'" + $sh_c "dnf5 config-manager setopt \"docker-ce-*.enabled=0\"" + $sh_c "dnf5 config-manager setopt \"docker-ce-$CHANNEL.enabled=1\"" fi $sh_c "dnf makecache" elif command_exists dnf; then @@ -578,8 +578,8 @@ do_install() { $sh_c "dnf config-manager --add-repo $repo_file_url" if [ "$CHANNEL" != "stable" ]; then - $sh_c "dnf config-manager --set-disabled 'docker-ce-*'" - $sh_c "dnf config-manager --set-enabled 'docker-ce-$CHANNEL'" + $sh_c "dnf config-manager --set-disabled \"docker-ce-*\"" + $sh_c "dnf config-manager --set-enabled \"docker-ce-$CHANNEL\"" fi $sh_c "dnf makecache" else @@ -587,8 +587,8 @@ do_install() { $sh_c "yum config-manager --add-repo $repo_file_url" if [ "$CHANNEL" != "stable" ]; then - $sh_c "yum config-manager --disable 'docker-ce-*'" - $sh_c "yum config-manager --enable 'docker-ce-$CHANNEL'" + $sh_c "yum config-manager --disable \"docker-ce-*\"" + $sh_c "yum config-manager --enable \"docker-ce-$CHANNEL\"" fi $sh_c "yum makecache" fi