Skip to content

Commit 7f08cb0

Browse files
committed
fix -f and -o clashing bug, and #6 #7
1 parent f804ae5 commit 7f08cb0

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

bin/observable-prerender

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ program
8383
if (["png", "svg", "jpeg"].includes(outFileFormat)) {
8484
format = outFileFormat;
8585
} else {
86-
console.error(
87-
`Uknown file type "${outFileFormat}" passed in for --out parameter. Have the path end in .svg, .png, or .jpeg, or use the --format flag.`
88-
);
89-
process.exit(1);
86+
if (!format) {
87+
console.error(
88+
`Unknown file type "${outFileFormat}" passed in for --out parameter. Have the path end in .svg, .png, or .jpeg, or use the --format flag.`
89+
);
90+
process.exit(1);
91+
}
9092
}
9193
} else {
9294
if (!format) format = "svg";

bin/observable-prerender-animate

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,18 @@ program
7373
redefine = [],
7474
redefineFile = [],
7575
fileAttachments = [],
76-
format,
7776
iter,
7877
iterWaitfor = [],
7978
outDir,
8079
token,
81-
width,
82-
height,
8380
headless,
81+
quiet,
8482
} = opts;
85-
let { width, height, format } = opts;
83+
let width, height, format;
84+
85+
width = opts.width;
86+
height = opts.height;
87+
format = opts.format;
8688

8789
if (width) width = +width;
8890
if (height) height = +height;

cli-examples/.DS_Store

-6 KB
Binary file not shown.

0 commit comments

Comments
 (0)