@@ -45,18 +45,18 @@ function main(o, config, configName, callback) {
4545 }
4646
4747 if ( verbose ) console . log ( 'Making/cleaning output directories' ) ;
48- ff . mkdirp ( outputDir + configName , function ( ) {
49- ff . rimraf ( outputDir + configName + '/*' , function ( ) {
48+ ff . mkdirp ( path . join ( outputDir , configName ) , function ( ) {
49+ ff . rimraf ( path . join ( outputDir , configName ) + '/*' , function ( ) {
5050 if ( config . directories ) {
5151 for ( let directory of config . directories ) {
52- ff . mkdirp . sync ( outputDir + configName + '/' + directory ) ;
52+ ff . mkdirp . sync ( path . join ( outputDir , configName , directory ) ) ;
5353 }
5454 }
5555 for ( let action of actions ) {
5656 if ( verbose ) console . log ( 'Rendering ' + action . output ) ;
5757 let template = Hogan . compile ( action . template ) ;
5858 let content = template . render ( model , config . partials ) ;
59- ff . createFile ( outputDir + configName + '/' + action . output , content , 'utf8' ) ;
59+ ff . createFile ( path . join ( outputDir , configName , action . output ) , content , 'utf8' ) ;
6060 }
6161 if ( config . touch ) { // may not now be necessary
6262 let touchTmp = Hogan . compile ( config . touch ) ;
@@ -65,17 +65,17 @@ function main(o, config, configName, callback) {
6565 for ( let file of files ) {
6666 file = file . trim ( ) ;
6767 if ( file ) {
68- if ( ! fs . existsSync ( outputDir + configName + '/' + file ) ) {
69- ff . createFile ( outputDir + configName + '/' + file , '' , 'utf8' ) ;
68+ if ( ! fs . existsSync ( path . join ( outputDir , configName , file ) ) ) {
69+ ff . createFile ( path . join ( outputDir , configName , file ) , '' , 'utf8' ) ;
7070 }
7171 }
7272 }
7373 }
7474 if ( config . apache ) {
75- ff . createFile ( outputDir + configName + '/ LICENSE', ff . readFileSync ( tpl ( '_common' , 'LICENSE' ) , 'utf8' ) , 'utf8' ) ;
75+ ff . createFile ( path . join ( outputDir , configName , ' LICENSE') , ff . readFileSync ( tpl ( '_common' , 'LICENSE' ) , 'utf8' ) , 'utf8' ) ;
7676 }
7777 else {
78- ff . createFile ( outputDir + configName + '/ LICENSE', ff . readFileSync ( tpl ( '_common' , 'UNLICENSE' ) , 'utf8' ) , 'utf8' ) ;
78+ ff . createFile ( path . join ( outputDir , configName , ' LICENSE') , ff . readFileSync ( tpl ( '_common' , 'UNLICENSE' ) , 'utf8' ) , 'utf8' ) ;
7979 }
8080 let outer = model ;
8181
@@ -89,7 +89,7 @@ function main(o, config, configName, callback) {
8989 let cApi = Object . assign ( { } , config . defaults , pa . defaults || { } , toplevel , api ) ;
9090 let filename = fnTemplate . render ( cApi , config . partials ) ;
9191 if ( verbose ) console . log ( 'Rendering ' + filename + ' (dynamic:' + pa . input + ')' ) ;
92- ff . createFile ( outputDir + configName + '/' + filename , template . render ( cApi , config . partials ) , 'utf8' ) ;
92+ ff . createFile ( path . join ( outputDir , configName , filename ) , template . render ( cApi , config . partials ) , 'utf8' ) ;
9393 }
9494 }
9595 }
@@ -105,7 +105,7 @@ function main(o, config, configName, callback) {
105105 outer . models . push ( effModel ) ;
106106 let filename = fnTemplate . render ( outer , config . partials ) ;
107107 if ( verbose ) console . log ( 'Rendering ' + filename + ' (dynamic:' + pm . input + ')' ) ;
108- ff . createFile ( outputDir + configName + '/' + filename , template . render ( outer , config . partials ) , 'utf8' ) ;
108+ ff . createFile ( path . join ( outputDir , configName , filename ) , template . render ( outer , config . partials ) , 'utf8' ) ;
109109 }
110110 }
111111 }
@@ -121,7 +121,7 @@ function main(o, config, configName, callback) {
121121 model . operations . push ( operation ) ;
122122 let filename = fnTemplate . render ( outer , config . partials ) ;
123123 if ( verbose ) console . log ( 'Rendering ' + filename + ' (dynamic:' + po . input + ')' ) ;
124- ff . createFile ( outputDir + configName + '/' + filename , template . render ( outer , config . partials ) , 'utf8' ) ;
124+ ff . createFile ( path . join ( outputDir , configName , filename ) , template . render ( outer , config . partials ) , 'utf8' ) ;
125125 }
126126 }
127127 }
0 commit comments