MCPcopy Index your code
hub / github.com/cameri/nostream / ensureConfirmed

Function ensureConfirmed

src/cli/commands/dev.ts:12–28  ·  view source on GitHub ↗
(message: string, yes?: boolean)

Source from the content-addressed store, hash-verified

10}
11
12const ensureConfirmed = async (message: string, yes?: boolean): Promise<boolean> => {
13 if (yes) {
14 return true
15 }
16
17 if (!process.stdin.isTTY) {
18 throw new Error('Interactive confirmation is unavailable. Re-run with --yes.')
19 }
20
21 const answer = await confirm({ message, initialValue: false })
22 if (isCancel(answer)) {
23 cancel('Operation cancelled')
24 return false
25 }
26
27 return answer
28}
29
30const runWithSpinner = async (
31 loadingText: string,

Callers 3

runDevDbCleanFunction · 0.85
runDevDbResetFunction · 0.85
runDevDockerCleanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected