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

Commit316b035

Browse files
committed
no-validate
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentcd0e4e9 commit316b035

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

‎src/build.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type BuildArgs = {
2525
markdown:string;
2626
yaml:string;
2727
output:string;
28+
noValidate:boolean;
2829
};
2930

3031
asyncfunctionbuild(args:string[]){
@@ -41,6 +42,8 @@ async function build(args: string[]) {
4142
// -o --output - default coderoad.json
4243
constoutput=
4344
getArg(args,{name:"output",alias:"o"})||"tutorial.json";
45+
constnoValidate=
46+
getArg(args,{name:"no-validate",alias:"nv"})!=="false";
4447

4548
console.log(`Building CodeRoad${output}...`);
4649

@@ -49,6 +52,7 @@ async function build(args: string[]) {
4952
output,
5053
markdown,
5154
yaml,
55+
noValidate,
5256
};
5357
}catch(e){
5458
console.error("Error parsing build logs");
@@ -139,10 +143,14 @@ async function build(args: string[]) {
139143

140144
// validate tutorial based on tutorial json schema
141145
try{
142-
constvalid=validateSchema(tutorialSchema,tutorial);
143-
if(!valid){
144-
console.error("Tutorial validation failed. See above to see what to fix");
145-
return;
146+
if(!options.noValidate){
147+
constvalid=validateSchema(tutorialSchema,tutorial);
148+
if(!valid){
149+
console.error(
150+
"Tutorial validation failed. See above to see what to fix"
151+
);
152+
return;
153+
}
146154
}
147155
}catch(e){
148156
console.error("Error validating tutorial schema:");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp