From f28d694879239d5d9c319185a278236d317a49b6 Mon Sep 17 00:00:00 2001 From: zachir Date: Sat, 30 Aug 2025 01:09:18 -0500 Subject: Make sh scrips POSIX compliant Using shellcheck, I went through all of them to make them standards compliant. I also tested as many as I could. --- video_download.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'video_download.sh') diff --git a/video_download.sh b/video_download.sh index ffbc4f7..acf52c9 100755 --- a/video_download.sh +++ b/video_download.sh @@ -3,20 +3,18 @@ VIDE_DIR="/var/tank/videos/Videos/" PLAY_DIR="/var/tank/videos/Playlists/" -PLAY_SUBS="$(ls -1 ${PLAY_DIR})" - LAST_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/video_download" get_videos () { - cd "$VIDE_DIR" + cd "$VIDE_DIR" || exit 1 yt-dlp "$(cat url.txt)" date '+%s' > "${LAST_FILE}.video.txt" } get_playlists () { - cd "$PLAY_DIR" - ls -1 | while read subdir; do - cd "$PLAY_DIR/$subdir" + cd "$PLAY_DIR" || exit 1 + find ./* -maxdepth 1 -type d | while read -r subdir; do + cd "$PLAY_DIR/$subdir" || exit 1 yt-dlp "$(cat url.txt)" done } -- cgit v1.2.3