File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ type BuildArgs = {
2525 markdown : string ;
2626 yaml : string ;
2727 output : string ;
28+ noValidate : boolean ;
2829} ;
2930
3031async function build ( args : string [ ] ) {
@@ -41,6 +42,8 @@ async function build(args: string[]) {
4142 // -o --output - default coderoad.json
4243 const output =
4344 getArg ( args , { name : "output" , alias : "o" } ) || "tutorial.json" ;
45+ const noValidate =
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- const valid = 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+ const valid = 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:" ) ;
You can’t perform that action at this time.
0 commit comments