Skip to content

Commit

Permalink
Fix non-TTY handling for proof inputs
Browse files Browse the repository at this point in the history
The `proof create` command was defaulting to stdin in non-TTY contexts, but
this also applies on CI. This is an imperfect fix that falls back to the
default filenames if the input from stdin is empty.

Merges #92
  • Loading branch information
sangaline authored Mar 15, 2024
1 parent 1bfc70d commit 9f5ce2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cli/proof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const proofCreateCommand = new Command()
.description("Create a proof for the circuit.")
.option(
"-i, --input <input>",
"Input file for the proof (defaults to stdin in on-TTY; " +
"Input file for the proof (defaults to stdin if non-TTY; " +
"`input.json`, `example-input.json`, or `Prover.toml` otherwise).",
)
.option("-t, --tag <tag>", "Tag to generate the proof from.", "latest")
Expand Down Expand Up @@ -92,7 +92,8 @@ const proofCreateCommand = new Command()
} else if (!process.stdin.isTTY || input === "-") {
// Read from stdin in a non-TTY context.
proofInput = await readStdin();
} else {
}
if (!proofInput || !proofInput.trim()) {
// Try to load from common input filenames.
const defaultInputFiles = [
"input.json",
Expand Down

0 comments on commit 9f5ce2c

Please sign in to comment.