Skip to content

Commit 30985e4

Browse files
committed
exit early if yaml parsing fails
Signed-off-by: shmck <[email protected]>
1 parent 016d4d6 commit 30985e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/build.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ async function build(args: string[]) {
7676
let skeleton;
7777
try {
7878
skeleton = yamlParser.load(_yaml);
79-
if (!skeleton || !skeleton.length) {
80-
throw new Error("Invalid yaml file contents");
79+
if (!skeleton || !Object.keys(skeleton).length) {
80+
throw new Error(`Skeleton at "${options.yaml}" is invalid`);
8181
}
8282
} catch (e) {
8383
console.error("Error parsing yaml");
8484
console.error(e.message);
85+
return;
8586
}
8687

8788
// validate skeleton based on skeleton json schema

0 commit comments

Comments
 (0)