2024-10-24 11:23:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ! -d "content/albums" ]
|
|
|
|
then
|
|
|
|
echo "You are not in the correct directory. Aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "content/albums/_index.md" ]
|
|
|
|
then
|
|
|
|
echo "You already have an _index.md file. This looks like you are in the template."
|
|
|
|
echo "You need to run this script from the main page directory."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-11-04 20:11:58 +00:00
|
|
|
find content/albums -type d "$@" | while read dir
|
2024-10-24 11:23:41 +00:00
|
|
|
do
|
|
|
|
(
|
|
|
|
echo "Creating archive for $dir"
|
|
|
|
cd "$dir"
|
|
|
|
|
2024-11-06 10:20:06 +00:00
|
|
|
update=
|
|
|
|
if [ -f album.zip ]
|
|
|
|
then
|
|
|
|
update=-u
|
|
|
|
fi
|
|
|
|
find -type f -iname "*.jpg" | grep -v '/thumbnail.jpg$' | zip $update album.zip -@
|
2024-10-24 11:23:41 +00:00
|
|
|
)
|
|
|
|
done
|