Skip to content

Commit

Permalink
gen: copy template files that do not need to be altered
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 6, 2017
1 parent 5d3f93a commit 0ca23fe
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions bin/express
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ function createApplication(app_name, path) {
// JavaScript
var app = loadTemplate('js/app.js');
var www = loadTemplate('js/www');
var index = loadTemplate('js/routes/index.js');
var users = loadTemplate('js/routes/users.js');

// CSS
var css = loadTemplate('css/style.css');
var less = loadTemplate('css/style.less');
var stylus = loadTemplate('css/style.styl');
var compass = loadTemplate('css/style.scss');
var sass = loadTemplate('css/style.sass');

mkdir(path, function(){
mkdir(path + '/public');
Expand All @@ -151,26 +142,27 @@ function createApplication(app_name, path) {
mkdir(path + '/public/stylesheets', function(){
switch (program.css) {
case 'less':
write(path + '/public/stylesheets/style.less', less);
copy_template('css/style.less', path + '/public/stylesheets/style.less')
break;
case 'stylus':
write(path + '/public/stylesheets/style.styl', stylus);
copy_template('css/style.styl', path + '/public/stylesheets/style.styl')
break;
case 'compass':
write(path + '/public/stylesheets/style.scss', compass);
copy_template('css/style.scss', path + '/public/stylesheets/style.scss')
break;
case 'sass':
write(path + '/public/stylesheets/style.sass', sass);
copy_template('css/style.sass', path + '/public/stylesheets/style.sass')
break;
default:
write(path + '/public/stylesheets/style.css', css);
copy_template('css/style.css', path + '/public/stylesheets/style.css')
break
}
complete();
});

mkdir(path + '/routes', function(){
write(path + '/routes/index.js', index);
write(path + '/routes/users.js', users);
copy_template('js/routes/index.js', path + '/routes/index.js')
copy_template('js/routes/users.js', path + '/routes/users.js')
complete();
});

Expand Down Expand Up @@ -305,7 +297,7 @@ function createApplication(app_name, path) {
});

if (program.git) {
write(path + '/.gitignore', fs.readFileSync(__dirname + '/../templates/js/gitignore', 'utf-8'));
copy_template('js/gitignore', path + '/.gitignore')
}

complete();
Expand Down

0 comments on commit 0ca23fe

Please sign in to comment.