mirror of
https://github.com/gnekt/My-Brain-Is-Full-Crew.git
synced 2026-09-07 22:36:26 +00:00
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
This commit is contained in:
@@ -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..."
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user