Skip to content

Commit b5bb39d

Browse files
committed
fix: abort delete in non-interactive mode unless --force is set
Previously, confirmAction returned true when stdin was not a TTY, allowing destructive deletes to proceed silently in CI/cron/pipes. Now it returns false, requiring explicit --force for non-interactive use.
1 parent 283d2a0 commit b5bb39d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/cli/args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func confirmAction(cmd *cobra.Command, message string) bool {
4949
return true
5050
}
5151
if !term.IsTerminal(int(os.Stdin.Fd())) {
52-
return true
52+
return false
5353
}
5454
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s [y/N]: ", message)
5555
scanner := bufio.NewScanner(cmd.InOrStdin())

0 commit comments

Comments
 (0)