#!/usr/bin/env bash
# Revision: 2
# Sample pre-commit hook: bump revision and update all tracked files, then stage them.
# Install: cp emmc-provisioning/scripts/pre-commit-revision.sh .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
# Or: ln -sf ../../emmc-provisioning/scripts/pre-commit-revision.sh .git/hooks/pre-commit

set -e
ROOT="$(git rev-parse --show-toplevel)"
cd "$ROOT"
"$ROOT/emmc-provisioning/scripts/bump-revision.sh"
git add REVISION
git add emmc-provisioning/scripts/bump-revision.sh \
  emmc-provisioning/scripts/pre-commit-revision.sh \
  emmc-provisioning/host/build-cloudinit-image.sh \
  emmc-provisioning/host/flash-emmc-on-connect.sh \
  emmc-provisioning/host/run-shrink-on-host.sh \
  emmc-provisioning/host/README.md \
  emmc-provisioning/host/cm4-flash-trigger.sh \
  emmc-provisioning/dashboard/app.py \
  emmc-provisioning/dashboard/templates/index.html \
  emmc-provisioning/dashboard/templates/home.html \
  emmc-provisioning/dashboard/templates/cloudinit_build.html \
  emmc-provisioning/dashboard/templates/admin.html \
  emmc-provisioning/dashboard/templates/login.html \
  emmc-provisioning/dashboard/templates/portal_files.html \
  emmc-provisioning/cloud-init/first-boot.sh \
  emmc-provisioning/cloud-init/first-boot.conf \
  emmc-provisioning/cloud-init/fileserver/start-chromium.sh \
  emmc-provisioning/cloud-init/fileserver/01-set-rotation-once.sh \
  emmc-provisioning/cloud-init/fileserver/02-set-wallpaper-once.sh \
  emmc-provisioning/cloud-init/fileserver/set-rotation-at-login.sh \
  emmc-provisioning/cloud-init/fileserver/five-tap-close-chromium.py \
  emmc-provisioning/scripts/deploy-to-proxmox.sh \
  emmc-provisioning/scripts/deploy-dashboard-to-lxc.sh \
  emmc-provisioning/scripts/sync-portal-files-to-lxc.sh \
  README.md \
  emmc-provisioning/README.md
exit 0
