mirror of
https://github.com/mfocko/blog.git
synced 2024-11-13 01:30:29 +01:00
Matej Focko
a868efaee6
* Switch the archiving from the ‹zip› to ‹tar.gz› and ‹tar.bz2› * Adjust the static files to have consistent paths Signed-off-by: Matej Focko <me@mfocko.xyz>
17 lines
No EOL
472 B
Bash
17 lines
No EOL
472 B
Bash
#!/bin/sh
|
|
|
|
# remove preexisting archives
|
|
find ./static/files -name '*.tar.gz' -exec rm {} \;
|
|
find ./static/files -name '*.tar.bz2' -exec rm {} \;
|
|
|
|
for relative_path in $(find ./static/files -name '.archive' -print); do
|
|
relative_path=$(dirname $relative_path)
|
|
base=$(basename $relative_path)
|
|
cd $relative_path/..
|
|
|
|
all_files=$(find $base/** ! -name '.archive' -print)
|
|
tar cvaf $base.tar.gz $all_files
|
|
tar cvaf $base.tar.bz2 $all_files
|
|
|
|
cd -
|
|
done; |