Skip to content

Commit

Permalink
refactored express(1) package.json generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Feb 18, 2012
1 parent e46431e commit 16b6a64
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions bin/express
Expand Up @@ -294,19 +294,19 @@ function createApplicationAt(path) {
app = app.replace(':TEMPLATE', program.template);

// package.json
var json = '{' + eol;
json += ' "name": "application-name"' + eol;
json += ' , "version": "0.0.1"' + eol;
json += ' , "private": true' + eol;
json += ' , "dependencies": {' + eol;
json += ' "express": "' + express.version + '"' + eol;
if (program.css) json += ' , "' + program.css + '": "*"' + eol;
if (program.template) json += ' , "' + program.template + '": "*"' + eol;
json += ' }' + eol;
json += '}';


write(path + '/package.json', json);
var pkg = {
name: 'application-name'
, version: '0.0.1'
, private: true
, dependencies: {
express: express.version
}
}

if (program.css) pkg.dependencies[program.css] = '*';
if (program.template) pkg.dependencies[program.template] = '*';

write(path + '/package.json', JSON.stringify(pkg, null, 2));
write(path + '/app.js', app);
});
}
Expand Down

0 comments on commit 16b6a64

Please sign in to comment.