gallery-video nix shebang

This commit is contained in:
Danilo Reyes 2024-12-14 18:12:40 -06:00
parent 7390d4af46
commit 3a95b5fd03

View File

@ -1,4 +1,5 @@
#! /etc/profiles/per-user/jawz/bin/bash #! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
# Source and destination directories # Source and destination directories
SRC_DIR="/srv/server/pool/scrapping/JawZ/gallery-dl" SRC_DIR="/srv/server/pool/scrapping/JawZ/gallery-dl"
@ -9,14 +10,11 @@ mkdir -p "$DEST_DIR"
# Find all the desired files and process them # Find all the desired files and process them
find "$SRC_DIR" -type f \( -name "*.mp4" -o -name "*.webm" -o -name "*.sfw" -o -name "*.m4v" -o -name "*.wav" -o -name "*.m4a" -o -name "*.ytdl" -o -name "*.mkv" \) | while read -r FILE; do find "$SRC_DIR" -type f \( -name "*.mp4" -o -name "*.webm" -o -name "*.sfw" -o -name "*.m4v" -o -name "*.wav" -o -name "*.m4a" -o -name "*.ytdl" -o -name "*.mkv" \) | while read -r FILE; do
# Get the relative path
REL_PATH="${FILE#"$SRC_DIR"/}" REL_PATH="${FILE#"$SRC_DIR"/}"
# Create the destination directory structure
DEST_PATH="$DEST_DIR/$(dirname "$REL_PATH")" DEST_PATH="$DEST_DIR/$(dirname "$REL_PATH")"
mkdir -p "$DEST_PATH" mkdir -p "$DEST_PATH"
# Move the file
mv "$FILE" "$DEST_PATH/" mv "$FILE" "$DEST_PATH/"
done done