From 0ba7d496c20b6e021f691846790b3c9939739830 Mon Sep 17 00:00:00 2001 From: Chris Christiansen Date: Thu, 21 May 2026 01:09:44 +0000 Subject: [PATCH] OPAX boot + GitHub auth helper --- scripts/osv-auto-commit.sh | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 scripts/osv-auto-commit.sh diff --git a/scripts/osv-auto-commit.sh b/scripts/osv-auto-commit.sh new file mode 100755 index 0000000..91d58d2 --- /dev/null +++ b/scripts/osv-auto-commit.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# OSVauco auto-commit — legger bare til "lovlige" paths + +set -euo pipefail + +GREEN="$(tput setaf 2 || true)" +YELLOW="$(tput setaf 3 || true)" +RED="$(tput setaf 1 || true)" +RESET="$(tput sgr0 || true)" + +echo "============================================================" +echo " OSVAUCO · AUTO-COMMIT" +echo "============================================================" +echo + +# Vis kort status +git status --short || { + echo " ${RED}git status feilet — er du i riktig repo?${RESET}" + exit 1 +} + +echo +echo " ${YELLOW}Legger til endringer i disse pathene:${RESET}" +echo " - docs/" +echo " - scripts/" +echo " - .gemini/" +echo " - README*" +echo + +git add docs/ scripts/ .gemini/ README* 2>/dev/null || true + +if git diff --cached --quiet; then + echo " ${YELLOW}Ingen staged endringer etter filteret — ingenting å committe.${RESET}" + exit 0 +fi + +echo +read -r -p "[OSVauco] Commit-melding: " MSG +if [ -z "$MSG" ]; then + echo " ${RED}Avbryter: tom commit-melding.${RESET}" + exit 1 +fi + +git commit -m "$MSG" +echo " ${GREEN}✅ Commit OK. Husk: git push origin main${RESET}"