#!/bin/bash PATH=~/go/bin:$PATH BASE_DIR="$(realpath "$(dirname "$0")")" OBSIDIAN_NOTES="${BASE_DIR}/.." QUARTZ_FOLDER="${OBSIDIAN_NOTES}/../quartz" QUARTZ_CONTENT="${QUARTZ_FOLDER}/content" GIT_REF=34bb5aa type hugo-obsidian || \ go install github.com/jackyzha0/hugo-obsidian@"${GIT_REF}" cd "${QUARTZ_FOLDER}" rm -rf public resources linkmap > /dev/null rm assets/indices/* hugo-obsidian \ -input="./content" \ -output="./assets/indices" \ -index \ -root="." cd "${QUARTZ_CONTENT}" if git diff --exit-code; then notify-send "Quartz" "No changes" exit fi git add ./ && \ git commit -m "Updated: $(date +%Y.%m.%d-%H%M)" && \ git push && \ notify-send "Quartz" "Pushed changes"