26 lines
585 B
Bash
Executable File
26 lines
585 B
Bash
Executable File
#!/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
|