Reset removes a task's state so that it acts as if it has never run.
(key string)
| 280 | |
| 281 | // Reset removes a task's state so that it acts as if it has never run. |
| 282 | func Reset(key string) { |
| 283 | err := os.Remove(statePath(key)) |
| 284 | if errors.Is(err, os.ErrNotExist) { |
| 285 | return |
| 286 | } |
| 287 | if err != nil { |
| 288 | err = taskError(key, fmt.Errorf("remove state file: %v", err)) |
| 289 | slog.Error("ignoring setup task reset error", "err", err, "task", key) |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | type state struct { |
| 294 | ConfirmPrompt confirmPrompt `json:"confirm_prompt,omitempty"` |