Skip to content

Commit 54cf3ba

Browse files
committed
fix: resume onboarding when bootstrap pending
1 parent 871f029 commit 54cf3ba

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

public/install.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,41 @@ run_doctor() {
521521
echo -e "${SUCCESS}${NC} Migration complete"
522522
}
523523

524+
resolve_workspace_dir() {
525+
local profile="${CLAWDBOT_PROFILE:-default}"
526+
if [[ "${profile}" != "default" ]]; then
527+
echo "${HOME}/clawd-${profile}"
528+
else
529+
echo "${HOME}/clawd"
530+
fi
531+
}
532+
533+
run_bootstrap_onboarding_if_needed() {
534+
if [[ "${NO_ONBOARD}" == "1" ]]; then
535+
return
536+
fi
537+
538+
local workspace
539+
workspace="$(resolve_workspace_dir)"
540+
local bootstrap="${workspace}/BOOTSTRAP.md"
541+
542+
if [[ ! -f "${bootstrap}" ]]; then
543+
return
544+
fi
545+
546+
if [[ ! -r /dev/tty || ! -w /dev/tty ]]; then
547+
echo -e "${WARN}${NC} BOOTSTRAP.md found at ${INFO}${bootstrap}${NC}; no TTY, skipping onboarding."
548+
echo -e "Run ${INFO}clawdbot onboard${NC} later to finish setup."
549+
return
550+
fi
551+
552+
echo -e "${WARN}${NC} BOOTSTRAP.md found at ${INFO}${bootstrap}${NC}; starting onboarding..."
553+
clawdbot onboard || {
554+
echo -e "${ERROR}Onboarding failed; BOOTSTRAP.md still present. Re-run ${INFO}clawdbot onboard${ERROR}.${NC}"
555+
return
556+
}
557+
}
558+
524559
resolve_clawdbot_version() {
525560
local version=""
526561
if command -v clawdbot &> /dev/null; then
@@ -630,6 +665,9 @@ EOF
630665
run_doctor
631666
fi
632667

668+
# Step 7: If BOOTSTRAP.md is still present in the workspace, resume onboarding
669+
run_bootstrap_onboarding_if_needed
670+
633671
local installed_version
634672
installed_version=$(resolve_clawdbot_version)
635673

0 commit comments

Comments
 (0)