@@ -51,7 +51,7 @@ const libraries = Object.keys(libraryMap);
5151
5252hbs . registerPartial (
5353 "octocat" ,
54- fs . readFileSync ( path . join ( __dirname , "/ partials/ octocat.handlebars" ) , "utf8" )
54+ fs . readFileSync ( path . join ( __dirname , ".." , " partials" , " octocat.handlebars") , "utf8" )
5555) ;
5656
5757// Helper to color progress bar based on test scores
@@ -66,14 +66,15 @@ hbs.registerHelper("warning-level", function (score) {
6666 }
6767} ) ;
6868
69- const tmpl = fs . readFileSync ( path . join ( __dirname , "index.handlebars" ) , "utf8" ) ;
69+ const tmpl = fs . readFileSync ( path . join ( __dirname , ".." , " index.handlebars") , "utf8" ) ;
7070const render = hbs . compile ( tmpl ) ;
7171const out = render ( { libraries : buildContext ( libraries ) } ) ;
7272
7373function buildContext ( libraries ) {
7474 return libraries . map ( library => {
7575 const repo = require ( path . resolve (
7676 __dirname ,
77+ ".." ,
7778 "libraries" ,
7879 library ,
7980 "results/repo.json"
@@ -97,6 +98,7 @@ function buildContext(libraries) {
9798function getTestResults ( library ) {
9899 const json = require ( path . resolve (
99100 __dirname ,
101+ ".." ,
100102 "libraries" ,
101103 library ,
102104 "results/results.json"
@@ -111,6 +113,7 @@ function getTestResults(library) {
111113function getIssues ( library ) {
112114 return require ( path . resolve (
113115 __dirname ,
116+ ".." ,
114117 "libraries" ,
115118 library ,
116119 "meta/issues.json"
@@ -120,13 +123,13 @@ function getIssues(library) {
120123// Collect markdown summary of library, process markdown, and return as string.
121124function getSummary ( library ) {
122125 const md = fs . readFileSync (
123- path . resolve ( __dirname , "libraries" , library , "meta/summary.md" ) ,
126+ path . resolve ( __dirname , ".." , " libraries", library , "meta/summary.md" ) ,
124127 "utf8"
125128 ) ;
126129 const content = marked . parse ( md ) ;
127130
128131 return { content } ;
129132}
130133
131- // npm build script writes this output to index.html
132- console . log ( out ) ;
134+ fs . mkdirSync ( path . resolve ( __dirname , '../../out' ) , { recursive : true } ) ;
135+ fs . writeFileSync ( path . resolve ( __dirname , '../../out/index.html' ) , out ) ;
0 commit comments