@@ -25,6 +25,7 @@ type BuildArgs = {
25
25
markdown :string ;
26
26
yaml :string ;
27
27
output :string ;
28
+ noValidate :boolean ;
28
29
} ;
29
30
30
31
async function build ( args :string [ ] ) {
@@ -41,6 +42,8 @@ async function build(args: string[]) {
41
42
// -o --output - default coderoad.json
42
43
const output =
43
44
getArg ( args , { name :"output" , alias :"o" } ) || "tutorial.json" ;
45
+ const noValidate =
46
+ getArg ( args , { name :"no-validate" , alias :"nv" } ) !== "false" ;
44
47
45
48
console . log ( `Building CodeRoad${ output } ...` ) ;
46
49
@@ -49,6 +52,7 @@ async function build(args: string[]) {
49
52
output,
50
53
markdown,
51
54
yaml,
55
+ noValidate,
52
56
} ;
53
57
} catch ( e ) {
54
58
console . error ( "Error parsing build logs" ) ;
@@ -139,10 +143,14 @@ async function build(args: string[]) {
139
143
140
144
// validate tutorial based on tutorial json schema
141
145
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
+ }
146
154
}
147
155
} catch ( e ) {
148
156
console . error ( "Error validating tutorial schema:" ) ;