#!/bin/sh -e title='rgz.ee' url='https://rgz.ee' dst="/var/www/htdocs/rgz.ee" raw="$dst/raw" src="$dst/src" rm -rf "${dst:?}/.files" rm -rf "${raw:?}" rm -rf "${src:?}" if test -z "${PWD##*.git}" then repo="$PWD" else repo="$PWD/.git" fi echo "${title}" > "$repo/owner" echo "${url##*//}" > "$repo/description" echo "${url}/raw/.git" > "$repo/url" mkdir -p "$raw" git --git-dir "$repo" --work-tree "$raw" reset --hard master "$HOME/bin/ssg6" "$raw" "$dst" "$title" "$url" > /dev/null find "$dst" -newer "$dst/raw" -type f -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.svg" | while read f; do test -f "$f" && gzip -kvf9S gz "$f"; done hostname > "$dst/hostname"