From a58b58a655bd276bdac9f531a8bb86e421f2556d Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 16 Dec 2020 21:21:20 +0100 Subject: [PATCH] Make files_before and files_after local. --- download-yt-feeds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download-yt-feeds b/download-yt-feeds index 227f0c6..56a5afc 100755 --- a/download-yt-feeds +++ b/download-yt-feeds @@ -56,7 +56,7 @@ function main() [[ -z "${max_videos}" ]] && local max_videos="last" mkdir -p "${download_dir}" - files_before="$(find "${download_dir}" -type f)" + local files_before="$(find "${download_dir}" -type f)" local -a feedlist=("${(@Q)${(z)$(read_feedlist)}}") for feed in ${feedlist}; do youtube-dl \ @@ -69,7 +69,7 @@ function main() "${feed}" # [[ ${?} -eq 0 ]] || die 3 "youtube-dl returned an error." done - files_after="$(find "${download_dir}" -type f)" + local files_after="$(find "${download_dir}" -type f)" while read file; do # https://stackoverflow.com/a/8811800/5965450 if [[ "${files_before#*${file}}" == "${files_before}" ]]; then