feat(installer): offer CodeGraph Pro beta signup after install and upgrade (#1297)
One-time, strictly opt-in prompt at the end of codegraph install and codegraph upgrade to join the CodeGraph Pro beta waitlist (same list as the getcodegraph.com homepage form). Nothing is sent unless the user answers yes AND enters an email; either answer is recorded machine-wide so no later install or upgrade re-asks, and --yes / non-interactive / CI runs never see the prompt. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
2b0b4b587e
commit
a66683d3eb
@@ -296,6 +296,13 @@ export interface UpgradeDeps {
|
||||
warn: (msg: string) => void;
|
||||
error: (msg: string) => void;
|
||||
platform: NodeJS.Platform;
|
||||
/**
|
||||
* Offer the one-time CodeGraph Pro beta opt-in after a successful update
|
||||
* (see installer/beta-signup — self-gating: TTY only, and silent forever
|
||||
* once any install/upgrade ask was answered). Optional so unit tests and
|
||||
* embedded callers stay prompt-free; never fatal to the upgrade.
|
||||
*/
|
||||
offerBetaSignup?: () => Promise<void>;
|
||||
}
|
||||
|
||||
const c = {
|
||||
@@ -413,6 +420,15 @@ export async function runUpgrade(opts: UpgradeOptions, deps: UpgradeDeps): Promi
|
||||
} else {
|
||||
deps.log(c.dim('Skipped refreshing agent instructions/config — run `codegraph install --refresh` once the PATH is fixed.'));
|
||||
}
|
||||
// Reached only after a real binary update (check/up-to-date/npx/source
|
||||
// all returned earlier) — the one place the upgrade path may offer the
|
||||
// beta opt-in. The hook self-gates on TTY + the stored once-per-machine
|
||||
// choice, so an already-answered user never sees it again.
|
||||
try {
|
||||
await deps.offerBetaSignup?.();
|
||||
} catch {
|
||||
/* a marketing question must never fail the upgrade */
|
||||
}
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user