update command
This commit is contained in:
24
zip.sh
Executable file
24
zip.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 [ -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
|
||||
Reference in New Issue
Block a user