Files
git-portfolio/automation/apply.sh

23 lines
815 B
Bash
Executable File

#!/usr/bin/bash
dst=/root/data/small/caddy/srv/seanhealy.ie/projects
dst_dir=$(dirname "$dst")
if [ ! -d "$dst_dir" ]; then
echo "Destination directory does not exist: $dst_dir"
exit 1
fi
mkdir -p "$dst_dir"
./git-portfolio "$dst"
tmp_web_footer_dir="/tmp/web-footer-$(date +%N)"
echo Cloning web-footer to "$tmp_web_footer_dir"... >&2
git clone --depth 1 --branch main git@git.seanhealy.ie:sean/web-footer.git "$tmp_web_footer_dir"
if [ $? != 0 ] || [ ! -d "$tmp_web_footer_dir" ]; then
echo "Failed to clone web-footer repository." >&2
exit 1
fi
echo Re-personalising HTML files... >&2
(cd "$tmp_web_footer_dir" && ./automation/personalise.sh)
echo Cleaning up... >&2
if [ "$tmp_web_footer_dir" ] && [ -d "$tmp_web_footer_dir" ] && [ -d "$tmp_web_footer_dir/.git" ]; then
rm -rf "$tmp_web_footer_dir"
fi