Skip to content
Myr

Implemented --template support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 3c911cc · Browse files · 1 file+16 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−5 removed

  • other:+16 added−5 removed

1 file+16 added−5 removed

modified:bin/express+16 added-5 removed
175 unmodified lines
176 , '// Configuration'177 , ''178 , 'app.configure(function(){'179 , ' app.set(\'views\', __dirname + \'/views\');'180 , ' app.set(\'view engine\', \'jade\');'180 , ' app.set(\'view engine\', \':TEMPLATE\');'181 , ' app.use(express.bodyDecoder());'182 , ' app.use(express.methodOverride());:SESS:CSS'183 , ' app.use(app.router);'184 , ' app.use(express.staticProvider(__dirname + \'/public\'));'
107 unmodified lines
292 write(path + '/public/stylesheets/style.css', css);293 }294 });295 mkdir(path + '/views/partials', function(){296 switch (templateEngine) {297 case 'ejs':298 write(path + '/views/layout.ejs', ejsLayout);299 write(path + '/views/index.ejs', ejsIndex);300 break;301 case 'jade':296 write(path + '/views/layout.jade', jadeLayout);297 write(path + '/views/index.jade', jadeIndex);302 write(path + '/views/layout.jade', jadeLayout);303 write(path + '/views/index.jade', jadeIndex);304 break;305 }306 });307 mkdir(path + '/test', function(){308 write(path + '/test/app.test.js', appTest);309 });
12 unmodified lines
322 app = app.replace(':SESS', sessions323 ? '\n app.use(express.cookieDecoder());\n app.use(express.session());'324 : '');325326 // Template support327 app = app.replace(':TEMPLATE', templateEngine);328329 write(path + '/app.js', app);330331 // Suggestions332 process.on('exit', function(){
2 unmodified lines
335 , cssEngine336 , cssEngine);337 }338 console.log(' - make sure you have installed %s: \x1b[33m$ npm install %s\x1b[0m'328 , 'jade'329 , 'jade');339 , templateEngine340 , templateEngine);341 });342 });343}344
81 unmodified lines