From: Thanh Ha Date: Thu, 16 Jan 2020 02:26:37 +0000 (+1000) Subject: Resolve shellcheck SC2129 use {...} >> file X-Git-Tag: v0.50.0~20 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=55afab878df8cfead43ac4b19e5958ee52737627;p=releng%2Fglobal-jjb.git Resolve shellcheck SC2129 use {...} >> file SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects. Signed-off-by: Thanh Ha Change-Id: Ib7327c9f5867379654ada6b89d415321fe9fc89a Signed-off-by: Anil Belur --- diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index 20092adb..8f7b3a85 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -327,11 +327,14 @@ for silo in $silos; do mkdir -p "$(dirname "$insert_file")" rm -f "$insert_file" - echo "" >> "$insert_file" - echo "//////////////////////////////////////////////////" >> "$insert_file" - echo "// Cloud config for $(basename "$cloud")" >> "$insert_file" - echo "//////////////////////////////////////////////////" >> "$insert_file" - echo "" >> "$insert_file" + { + echo "" + echo "//////////////////////////////////////////////////" + echo "// Cloud config for $(basename "$cloud")" + echo "//////////////////////////////////////////////////" + echo "" + } >> "$insert_file" + echo "templates = []" >> "$insert_file" mapfile -t templates < <(find "$cfg_dir" -maxdepth 1 -not -type d -not -name "cloud.cfg")