Apply suggestions from code review

Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
This commit is contained in:
Thilo Fromm 2023-05-22 12:14:04 +02:00 committed by GitHub
parent f66d24dec7
commit 83a85683c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -147,7 +147,7 @@ function _garbage_collect_impl() {
echo
echo "########################################"
echo
echo Running cloud garbace collector
echo Running cloud garbage collector
echo
local mantle_ref
@ -165,7 +165,7 @@ function _garbage_collect_impl() {
echo
echo "#############################################"
echo
echo Running Github CI SDK garbace collector
echo Running Github CI SDK garbage collector
echo
source ci-automation/garbage_collect_github_ci_sdk.sh

View File

@ -55,9 +55,9 @@ function _garbage_collect_github_ci_impl() {
echo "######## Full list of version(s) found ########"
echo "${versions_sorted}" | awk '{printf "%5d %s\n", NR, $0}'
local keep="$((keep + 1))" # for tail -n+...
local purge_versions="$(echo "${versions_sorted}" \
| tail -n+"${keep}")"
keep="$((keep + 1))" # for tail -n+...
local purge_versions
mapfile -t purge_versions < <(tail -n+"${keep}" <<<"${versions_sorted}")
source ci-automation/ci_automation_common.sh
local sshcmd="$(gen_sshcmd)"
@ -69,12 +69,12 @@ function _garbage_collect_github_ci_impl() {
echo "(NOTE this is just a dry run since DRY_RUN=y)"
echo
fi
echo "${purge_versions}" | awk -v keep="${keep}" '{if ($0 == "") next; printf "%5d %s\n", NR + keep - 1, $0}'
printf '%s\n' "${purge_versions[@]}" | awk -v keep="${keep}" '{if ($0 == "") next; printf "%5d %s\n", NR + keep - 1, $0}'
echo
echo
local version=""
for version in ${purge_versions}; do
for version in "${purge_versions[@]}"; do
echo "--------------------------------------------"
echo
echo "#### Processing version '${version}' ####"