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

Commitc965ff4

Browse files
committed
block tutorial validation
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent316b035 commitc965ff4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

‎src/build.ts

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

3131
asyncfunctionbuild(args:string[]){
@@ -42,8 +42,9 @@ async function build(args: string[]) {
4242
// -o --output - default coderoad.json
4343
constoutput=
4444
getArg(args,{name:"output",alias:"o"})||"tutorial.json";
45-
constnoValidate=
46-
getArg(args,{name:"no-validate",alias:"nv"})!=="false";
45+
constvalidate=getArg(args,{name:"validate",alias:"v"})!=="false";
46+
47+
console.log("validate",validate);
4748

4849
console.log(`Building CodeRoad${output}...`);
4950

@@ -52,7 +53,7 @@ async function build(args: string[]) {
5253
output,
5354
markdown,
5455
yaml,
55-
noValidate,
56+
validate,
5657
};
5758
}catch(e){
5859
console.error("Error parsing build logs");
@@ -143,13 +144,13 @@ async function build(args: string[]) {
143144

144145
// validate tutorial based on tutorial json schema
145146
try{
146-
if(!options.noValidate){
147+
if(options.validate){
147148
constvalid=validateSchema(tutorialSchema,tutorial);
148149
if(!valid){
149150
console.error(
150151
"Tutorial validation failed. See above to see what to fix"
151152
);
152-
return;
153+
// continue rather than exiting early
153154
}
154155
}
155156
}catch(e){

‎src/help.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Usage: coderoad validate [path] [options]
4747
4848
Options:
4949
--help (-h) display these help docs
50+
--validate (-v) run tutorial schema validation. Default is true, set to false to block validation.
5051
--clean (-c) set to false to preserve .tmp folder. Helpful for debugging
5152
5253
More docs at https://github.com/coderoad/coderoad-cli`);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp