File tree Expand file tree Collapse file tree 5 files changed +18
-65
lines changed Expand file tree Collapse file tree 5 files changed +18
-65
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ src/build.ts
66src /typings.d.ts
77src /README.md
88dist /cr.json
9+ coderoad.json
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22 "name" : " coderoad-builder" ,
33 "version" : " 0.1.0" ,
44 "description" : " Generates tutorial project files for the coderoad-viewer" ,
5- "main" : " build.js" ,
5+ "main" : " src/ build.js" ,
66 "directories" : {
77 "test" : " tests"
88 },
99 "scripts" : {
1010 "test" : " echo \" Error: no test specified\" && exit 1" ,
11- "start" : " node src/build.js src/README.md dist/cr.json "
11+ "start" : " node ./ src/build.js coderoad.json ./ src/README.md"
1212 },
1313 "author" : " Shawn McKay <shawn.j.mckay@gmail.com>" ,
14- "license" : " ISC" ,
15- "devDependencies" : {
16- "chai" : " ^3.4.1" ,
17- "mocha" : " ^2.3.4"
18- }
14+ "license" : " ISC"
1915}
Original file line number Diff line number Diff line change @@ -214,14 +214,15 @@ function isValidJSON(text) {
214214 return false ;
215215 }
216216}
217- var input = process . argv [ 2 ] ;
218- if ( ! input ) {
219- throw ( 'Pass in path to .md file' ) ;
220- }
221- var output = process . argv [ 3 ] ;
217+ console . log ( process . argv ) ;
218+ var output = process . argv [ 2 ] ;
222219if ( ! output ) {
223220 throw ( 'Pass in path to output cr.json file' ) ;
224221}
222+ var input = process . argv [ 3 ] ;
223+ if ( ! input ) {
224+ throw ( 'Pass in path to .md file' ) ;
225+ }
225226var result = cleanup ( build ( input ) ) ;
226227if ( ! isValidJSON ( result ) ) {
227228 throw ( 'Invalid JSON output' ) ;
Original file line number Diff line number Diff line change @@ -264,15 +264,18 @@ function isValidJSON(text: string) {
264264 }
265265}
266266
267- var input = process . argv [ 2 ] ;
268- if ( ! input ) {
269- throw ( 'Pass in path to .md file' ) ;
270- }
271- var output = process . argv [ 3 ] ;
267+ console . log ( process . argv ) ;
268+
269+ var output = process . argv [ 2 ] ;
272270if ( ! output ) {
273271 throw ( 'Pass in path to output cr.json file' ) ;
274272}
275273
274+ var input = process . argv [ 3 ] ;
275+ if ( ! input ) {
276+ throw ( 'Pass in path to .md file' ) ;
277+ }
278+
276279// Build
277280var result = cleanup ( build ( input ) ) ;
278281if ( ! isValidJSON ( result ) ) {
You can’t perform that action at this time.
0 commit comments