juan-canham-resume/build.sh
2020-03-17 03:54:15 +00:00

42 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
PATH="./node_modules/.bin/:$PATH"
for content in $(yq -r '.generate | keys[]' settings.yaml); do
echo "=== Generating ${content} themes with hackmyresume ==="
for theme in $(yq -r ".generate.${content}.plain[]?" settings.yaml); do
hackmyresume build "dist/${content}.json" TO "dist/${theme##*-}.all" -t "$theme"
done
echo "=== Generating ${content} themes with css ==="
if yq -ce ".generate.${content}.css" settings.yaml; then
for theme in $(yq -r ".generate.${content}.css | keys[]" settings.yaml); do
for css in $(yq -r ".generate.${content}.css[\"$theme\"][]" settings.yaml); do
hackmyresume build "dist/${content}.json" TO "dist/${css}.all" -t "./node_modules/$theme" --css "$css"
done
done
fi
echo "=== Generating ${content} themes with kcv ==="
hackmyresume convert "dist/${content}.json" resume.json
for theme in $(yq -r ".generate.${content}.kcv[]?" settings.yaml); do
for format in html pdf; do
kcv export "dist/kcv-${theme}.${format}" --theme "$theme"
done
done
mv resume.json "dist/${content}.jrs.json"
done
rm dist/*.*.html
for ext in $(yq -r '.primary | keys[]' settings.yaml); do
cp "dist/$(niet ".primary.$ext" settings.yaml).$ext" "dist/resume.$ext"
done
cp dist/"$(niet '.primary.md' settings.yaml)".md Resume.md
cp dist/full.jrs.json ./resume.jrs.json
cp dist/resume.json ./
cp resume.yaml dist/