@@ -25,7 +25,7 @@ type BuildArgs = {
25
25
markdown :string ;
26
26
yaml :string ;
27
27
output :string ;
28
- noValidate :boolean ;
28
+ validate :boolean ;
29
29
} ;
30
30
31
31
async function build ( args :string [ ] ) {
@@ -42,8 +42,9 @@ async function build(args: string[]) {
42
42
// -o --output - default coderoad.json
43
43
const output =
44
44
getArg ( args , { name :"output" , alias :"o" } ) || "tutorial.json" ;
45
- const noValidate =
46
- getArg ( args , { name :"no-validate" , alias :"nv" } ) !== "false" ;
45
+ const validate = getArg ( args , { name :"validate" , alias :"v" } ) !== "false" ;
46
+
47
+ console . log ( "validate" , validate ) ;
47
48
48
49
console . log ( `Building CodeRoad${ output } ...` ) ;
49
50
@@ -52,7 +53,7 @@ async function build(args: string[]) {
52
53
output,
53
54
markdown,
54
55
yaml,
55
- noValidate ,
56
+ validate ,
56
57
} ;
57
58
} catch ( e ) {
58
59
console . error ( "Error parsing build logs" ) ;
@@ -143,13 +144,13 @@ async function build(args: string[]) {
143
144
144
145
// validate tutorial based on tutorial json schema
145
146
try {
146
- if ( ! options . noValidate ) {
147
+ if ( options . validate ) {
147
148
const valid = validateSchema ( tutorialSchema , tutorial ) ;
148
149
if ( ! valid ) {
149
150
console . error (
150
151
"Tutorial validation failed. See above to see what to fix"
151
152
) ;
152
- return ;
153
+ // continue rather than exiting early
153
154
}
154
155
}
155
156
} catch ( e ) {