]> git.ipfire.org Git - people/ms/nightly-builds.git/commitdiff
Support spaces in directory names
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 Nov 2017 11:48:39 +0000 (11:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 Nov 2017 11:48:39 +0000 (11:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
server-scripts/ipfire-cleanup-nightly-builds.sh

index 59fb2fa52813b159ddc13dc89fb2ce0b677bdfc5..dcfc461aeab67b5394f13151f1c75956021bab95 100755 (executable)
@@ -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