MCPcopy Create free account
hub / github.com/jetify-com/devbox / ConfirmRun

Function ConfirmRun

internal/setup/setup.go:217–222  ·  view source on GitHub ↗

Run interactively prompts the user to confirm that it's ok to run a setup task. It only prompts the user if the task's NeedsRun method returns true. If the user refuses to run the task, then ConfirmPrompt will not ask them again. Call [Reset] to reset the task's state and re-prompt the user.

(ctx context.Context, key string, task Task, prompt string)

Source from the content-addressed store, hash-verified

215// the user refuses to run the task, then ConfirmPrompt will not ask them again.
216// Call [Reset] to reset the task's state and re-prompt the user.
217func ConfirmRun(ctx context.Context, key string, task Task, prompt string) error {
218 if prompt == "" {
219 return taskError(key, redact.Errorf("empty confirmation prompt"))
220 }
221 return run(ctx, key, task, prompt)
222}
223
224var defaultPrompt = func(msg string) (response any, err error) {
225 if isatty.IsTerminal(os.Stdin.Fd()) {

Callers 5

ConfigureFunction · 0.92
ConfigureRepromptFunction · 0.92
TestSudoDevboxFunction · 0.85

Calls 3

ErrorfFunction · 0.92
taskErrorFunction · 0.85
runFunction · 0.70

Tested by 3

TestSudoDevboxFunction · 0.68