update zip script
This commit is contained in:
@@ -15,3 +15,5 @@ RUN useradd -m mokurouser \
|
|||||||
&& chown -R mokurouser:mokurouser /home/mokurouser
|
&& chown -R mokurouser:mokurouser /home/mokurouser
|
||||||
|
|
||||||
WORKDIR /home/mokurouser/mokuro
|
WORKDIR /home/mokurouser/mokuro
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ services:
|
|||||||
user: 1000:1000
|
user: 1000:1000
|
||||||
volumes:
|
volumes:
|
||||||
- ~/S/japanese/manga:/home/mokurouser/mokuro
|
- ~/S/japanese/manga:/home/mokurouser/mokuro
|
||||||
command: mokuro --parent_dir One\ Piece\ Color --disable_confirmation && ./One\ Piece\ Color/zip.sh
|
command: mokuro --parent_dir One\ Piece\ Color --disable_confirmation && ./zip.sh "One Piece Color"
|
||||||
runtime: nvidia
|
runtime: nvidia
|
||||||
restart: no
|
restart: no
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
|||||||
21
zip.sh
Executable file
21
zip.sh
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Usage: ./zip.sh [directory]
|
||||||
|
# Default is current directory
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
DIR="${1:-.}"
|
||||||
|
|
||||||
|
cd "$DIR" || exit
|
||||||
|
|
||||||
|
for f in *.mokuro; do
|
||||||
|
[ -e "$f" ] || continue # skip if no .mokuro files
|
||||||
|
base="${f%.mokuro}"
|
||||||
|
dir="$base"
|
||||||
|
zipfile="$base.zip"
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
echo "Zipping: $zipfile <- $f $dir/"
|
||||||
|
zip -qr "$zipfile" "$f" "$dir"
|
||||||
|
else
|
||||||
|
echo "Warning: Directory '$dir' not found for '$f', skipping."
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user