|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ! -f "./Fork-Awesome/.git" ]; then
|
|
|
|
echo -e "\x1b[31;1mFA submodule is not initialized, exit...\x1b[m"
|
|
|
|
echo -e "Hint: try \x1b[36mgit submodule init && git submodule update\x1b[m"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "./wanted.ini" ]; then
|
|
|
|
echo -e "\x1b[31;1mMissing customization file './wanted.ini'!\x1b[m"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "./Fork-Awesome/.bundle" ]; then
|
|
|
|
echo -e "\x1b[31;1mGems not installed in the FA submodule, cannot build. Did you run install.sh?\x1b[m"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "./Fork-Awesome/node_modules" ]; then
|
|
|
|
echo -e "\x1b[31;1mNode modules not installed in the FA submodule, cannot build. Did you run install.sh?\x1b[m"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "=== Starting a build... ==="
|
|
|
|
(cd patcher && node ./apply-filter.js)
|
|
|
|
(cd "./Fork-Awesome/src/icons/" && make)
|
|
|
|
echo -e "\x1b[33mIf the make target failed at a \"cp\" statement, that is most likely safe to ignore\x1b[m"
|
|
|
|
|
|
|
|
fontname=$(cat fontcustom.yml | head -n1 | sed "s/font_name: //")
|
|
|
|
|
|
|
|
if [ ! -f "./Fork-Awesome/src/icons/$fontname/$fontname-preview.html" ]; then
|
|
|
|
echo -e "\x1b[31;1mBuild failed, output directory is empty.\x1b[m"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm ./output/*
|
|
|
|
cp "./Fork-Awesome/src/icons/$fontname/"* ./output
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo -e "\x1b[32;1m=== Your font \"$fontname\" is ready in the output/ directory ===\x1b[m"
|