File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ async function build (args: string[]) {
9191 // parse yaml skeleton config
9292 let skeleton
9393 try {
94- skeleton = yamlParser . load ( _yaml )
94+ skeleton = yamlParser . load ( _yaml ) as T . TutorialSkeleton
9595 if ( ! skeleton || ! Object . keys ( skeleton ) . length ) {
9696 throw new Error ( `Skeleton at "${ options . yaml } " is invalid` )
9797 }
Original file line number Diff line number Diff line change 99 createTestRunner
1010} from './utils/exec'
1111import { getCommits , CommitLogObject } from './utils/commits'
12+ import { TutorialSkeleton } from '../typings/tutorial'
1213
1314interface Options {
1415 yaml : string
@@ -34,14 +35,15 @@ async function validate (args: string[]) {
3435 // parse yaml config
3536 let skeleton
3637 try {
37- skeleton = yamlParser . load ( _yaml )
38+ skeleton = yamlParser . load ( _yaml ) as TutorialSkeleton
3839
3940 if ( ! skeleton ) {
4041 throw new Error ( 'Invalid yaml file contents' )
4142 }
4243 } catch ( e ) {
4344 console . error ( 'Error parsing yaml' )
4445 console . error ( e . message )
46+ return
4547 }
4648
4749 const codeBranch : string = skeleton . config . repo . branch
@@ -106,7 +108,7 @@ async function validate (args: string[]) {
106108 await cherryPick ( stepSetupCommits )
107109 }
108110 // run commands
109- if ( step . setup . commands ) {
111+ if ( step ? .setup ? .commands ) {
110112 console . info ( `--- Running setup commands...` )
111113 await runCommands ( step . setup . commands )
112114 }
Original file line number Diff line number Diff line change @@ -86,3 +86,8 @@ export interface TutorialDependency {
8686export interface TutorialAppVersions {
8787 vscode : string
8888}
89+
90+ export interface TutorialSkeleton {
91+ config : TutorialConfig
92+ levels : Level [ ]
93+ }
You can’t perform that action at this time.
0 commit comments