From 4c4843e396b2f90755302b49d01a8d761e777d7c Mon Sep 17 00:00:00 2001 From: gnekt Date: Mon, 23 Mar 2026 16:42:54 +0100 Subject: [PATCH] Add confirmation prompt before overwriting existing installation launchme.sh: - Detects if .claude/ or CLAUDE.md already exist in the vault - Shows the user what will be overwritten - Asks for explicit confirmation before proceeding - Clarifies that custom agents and vault notes are never touched updateme.sh: - Asks for confirmation before overwriting core files - Same clarification about custom agents being preserved --- scripts/launchme.sh | 26 ++++++++++++++++++++++++++ scripts/updateme.sh | 16 ++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/scripts/launchme.sh b/scripts/launchme.sh index 9617350..1c5eca7 100755 --- a/scripts/launchme.sh +++ b/scripts/launchme.sh @@ -60,6 +60,32 @@ if [[ "$CONFIRM" =~ ^[Nn]$ ]]; then [[ -d "$VAULT_DIR" ]] || die "Directory not found: $VAULT_DIR" fi +# ── Check for existing installation ─────────────────────────────────────── +echo "" +EXISTING=0 +if [[ -d "$VAULT_DIR/.claude" ]]; then EXISTING=1; fi +if [[ -f "$VAULT_DIR/CLAUDE.md" ]]; then EXISTING=1; fi + +if [[ $EXISTING -eq 1 ]]; then + warn "An existing installation was detected:" + [[ -d "$VAULT_DIR/.claude" ]] && warn " .claude/ directory exists" + [[ -f "$VAULT_DIR/CLAUDE.md" ]] && warn " CLAUDE.md exists" + echo "" + echo -e " ${BOLD}The installer needs to overwrite these files.${NC}" + echo -e " ${DIM}Custom agents in .claude/agents/ will NOT be deleted.${NC}" + echo -e " ${DIM}Your vault notes are never touched.${NC}" + echo "" + echo -e " ${BOLD}c)${NC} Continue (overwrite core files, keep custom agents)" + echo -e " ${BOLD}q)${NC} Quit" + read -r -p " > " OVERWRITE_ANSWER + if [[ ! "$OVERWRITE_ANSWER" =~ ^[Cc]$ ]]; then + echo "" + info "Installation cancelled." + echo "" + exit 0 + fi +fi + # ── Copy agents ───────────────────────────────────────────────────────────── echo "" info "Creating .claude/agents/ in vault..." diff --git a/scripts/updateme.sh b/scripts/updateme.sh index c1e455b..58a6a2d 100755 --- a/scripts/updateme.sh +++ b/scripts/updateme.sh @@ -45,6 +45,22 @@ echo -e "${BOLD}║ My Brain Is Full - Crew :: Update ║${NC}" echo -e "${BOLD}╚══════════════════════════════════════════╝${NC}" echo "" +# ── Confirm overwrite ──────────────────────────────────────────────────── +echo -e "${BOLD}This will overwrite core agent files, references, and CLAUDE.md.${NC}" +echo -e " ${DIM}Custom agents in .claude/agents/ will NOT be touched.${NC}" +echo -e " ${DIM}Your vault notes are never touched.${NC}" +echo "" +echo -e " ${BOLD}c)${NC} Continue" +echo -e " ${BOLD}q)${NC} Quit" +read -r -p " > " UPDATE_ANSWER +if [[ ! "$UPDATE_ANSWER" =~ ^[Cc]$ ]]; then + echo "" + info "Update cancelled." + echo "" + exit 0 +fi +echo "" + # ── Update agents ─────────────────────────────────────────────────────────── AGENT_COUNT=0 for agent in "$REPO_DIR/agents/"*.md; do