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