Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30985e4

Browse files
committed
exit early if yaml parsing fails
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent016d4d6 commit30985e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/build.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ async function build(args: string[]) {
7676
letskeleton;
7777
try{
7878
skeleton=yamlParser.load(_yaml);
79-
if(!skeleton||!skeleton.length){
80-
thrownewError("Invalidyaml file contents");
79+
if(!skeleton||!Object.keys(skeleton).length){
80+
thrownewError(`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)

[8]ページ先頭

©2009-2025 Movatter.jp