update run script

This commit is contained in:
2025-09-07 04:24:29 -07:00
parent 67593cc678
commit 383af5a61e
2 changed files with 5 additions and 5 deletions

25
run.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env sh
set -Eeuo pipefail
DIR="${1:-.}"
mokuro --parent_dir "$DIR" --disable_confirmation
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 [ -f "$zipfile" ]; then
echo "Warning: Zip file $zipfile already exists, skipping."
elif [ -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
rm -rf ./*.html