muflax65ngodyewp.onion/compress-html.sh

19 lines
352 B
Bash
Raw Permalink Normal View History

2012-02-04 21:17:48 +01:00
#!/bin/zsh
# Copyright muflax <mail@muflax.com>, 2012
# License: GNU GPL 3 <http://www.gnu.org/copyleft/gpl.html>
setopt RE_MATCH_PCRE
2012-04-12 19:00:22 +02:00
if [[ -z $1 ]]; then
echo "usage: $0 site"
exit 1
fi
2012-02-04 21:17:48 +01:00
2012-04-12 19:00:22 +02:00
echo "compressing site: $1..."
for f in out/$1/**/*(.); do
2012-02-04 21:17:48 +01:00
if [[ $f =~ "\.(html|css|xml|js)$" ]]; then
gzip --best -f -v -c "$f" > "$f.gz"
fi
done