From 225aecdf1270a9d7638e8a47cedd8723d5f58db5 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 29 Nov 2017 11:48:39 +0000 Subject: [PATCH] Support spaces in directory names Signed-off-by: Michael Tremer --- server-scripts/ipfire-cleanup-nightly-builds.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-scripts/ipfire-cleanup-nightly-builds.sh b/server-scripts/ipfire-cleanup-nightly-builds.sh index 59fb2fa..dcfc461 100755 --- a/server-scripts/ipfire-cleanup-nightly-builds.sh +++ b/server-scripts/ipfire-cleanup-nightly-builds.sh @@ -36,7 +36,7 @@ for branch in $(find "${BASEDIR}" -mindepth 1 -maxdepth 1 -type d); do counter=0 - for build in $(find "${branch}" -mindepth 1 -maxdepth 1 -type d | sort -nr); do + while read -r build; do time="$(basename "${build}")" [ "${time}" = "latest" ] && continue @@ -54,7 +54,7 @@ for branch in $(find "${BASEDIR}" -mindepth 1 -maxdepth 1 -type d); do if [[ ${age} -ge ${MAX_AGE} ]]; then rm -rf "${build}" fi - done + done <<< "$(find "${branch}" -mindepth 1 -maxdepth 1 -type d | sort -nr)" done exit 0 -- 2.47.3