@@ -25,6 +25,7 @@ type BuildArgs = {
2525markdown :string ;
2626yaml :string ;
2727output :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
4243const output =
4344getArg ( args , { name :"output" , alias :"o" } ) || "tutorial.json" ;
45+ const noValidate =
46+ getArg ( args , { name :"no-validate" , alias :"nv" } ) !== "false" ;
4447
4548console . 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 ) {
5458console . error ( "Error parsing build logs" ) ;
@@ -139,10 +143,14 @@ async function build(args: string[]) {
139143
140144// validate tutorial based on tutorial json schema
141145try {
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 ) {
148156console . error ( "Error validating tutorial schema:" ) ;