Skip to content

cook seed panics when the output directory cannot be created #706

Closed

Description

@drawmeanelephant

Suggested labels: bug, area: cli


Discovery audit finding M9 (medium) — cooklang/cookcli @ 7c2f48b (v0.38.1), audited 2026-10-12. Repro verified.

Summary

cook seed panics (exit 101) when the output directory can't be created.

Where

src/seed.rs:38 — fs::create_dir_all(path).expect("Couldn't create output path").

Repro

$ cook seed /dev/null/sub
thread 'main' panicked ... Couldn't create output path: NotADirectory
(exit 101)

Every other command fails with a clean Error:.

Expected

A clean Error: ... message and a nonzero exit code, like every other command.

Actual

A panic, exit 101.

Acceptance criteria (red → green)

  • Red: the repro exits 101 with a panic message.
  • Green: the repro prints Error: ... and exits nonzero without panicking.

Verification

Executed repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions