This repository has been archived on 2025-10-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
inter-font/docs/_scripts/serve.sh
2018-10-10 23:37:37 -07:00

31 lines
648 B
Bash
Executable file

#!/bin/sh
set -e
cd "$(dirname "$0")/.."
if [ ! -s lab/fonts ]; then
rm -rf lab/fonts
ln -fs ../../build/fonts lab/fonts
fi
rm -rf _site
# jekyll is a little dumb and resolves the lab/fonts symlink and copies
# all font files to _site when started. Bad jekyll.
# Let's work around that.
sh <<_EOF_ &
N=3
while [ \$N -gt 0 ]; do
sleep 1
ln -fs ../../../build/fonts _site/lab/fonts
sleep 5
if [ -d _site/lab/fonts ]; then
rm -rf _site/lab/fonts
else
rm -f _site/lab/fonts
fi
ln -fs ../../../build/fonts _site/lab/fonts
let N=N-1
done
_EOF_
jekyll serve --limit_posts 20 --watch --host 127.0.0.1 --port 3002 --open-url