Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
amendment to #98
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Grupp committed Jan 7, 2015
1 parent 56ff471 commit ee920a2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 41 deletions.
4 changes: 1 addition & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ var GulpIonicGenerator = yeoman.generators.Base.extend({
}
// save appModule in answers
this.answers.appModule = utils.modularize(this.answers.appName);
this.answers.includeSass = true; // TODO: set to true for now

// store answers in .yo-rc.json
this.config.set('answers', this.answers);
Expand Down Expand Up @@ -183,8 +182,7 @@ var GulpIonicGenerator = yeoman.generators.Base.extend({
this.template('_gulpfile.js', 'gulpfile.js');
this.write('app/index.html', indexFile);

var css = 'main.' + (this.answers.includeSass ? 's' : '') + 'css';
this.copy(css, 'app/styles/' + css);
this.copy('main.scss', 'app/styles/main.scss');
},

projectfiles: function () {
Expand Down
3 changes: 1 addition & 2 deletions app/sources/sample-answers.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ module.exports = {
plugins: [
'org.apache.cordova.device',
'org.apache.cordova.dialogs'
],
includeSass: true
]
},

/**
Expand Down
8 changes: 3 additions & 5 deletions app/templates/_gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ gulp.task('connect', function () {
});
});

gulp.task('serve', ['connect', 'inject'<% if (answers.includeSass) { %>, 'styles'<% } %>], function () {
gulp.task('serve', ['connect', 'inject', 'styles'], function () {
require('opn')('http://localhost:9000');
});

Expand Down Expand Up @@ -153,11 +153,9 @@ gulp.task('serve-build', ['connect-build'], function () {
gulp.task('wiredep', function () {
var wiredep = require('wiredep').stream;
// TODO:
//<% if (answers.includeSass) { %>
// gulp.src('app/styles/*.scss') // into main.scss
// .pipe(wiredep())
// .pipe(gulp.dest('app/styles'));
//<% } %>
return gulp.src('app/*.html') // into index.html
.pipe(wiredep({exclude: ['bower_components/ionic/release/css']}))
// exclude ionic scss since we're using ionic sass
Expand Down Expand Up @@ -194,8 +192,8 @@ gulp.task('watch', ['connect', 'serve'], function () {
// FIXME: not watching new files?!
});

// watch for changes in css/scss
gulp.watch('app/styles/**/*.<%= answers.includeSass ? 'scss' : 'css' %>', ['styles']);
// watch for changes in scss
gulp.watch('app/styles/**/*.scss', ['styles']);
// watch for changes in bower.json
gulp.watch('bower.json', ['wiredep']);
});
Expand Down
4 changes: 2 additions & 2 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"gulp-jshint": "^1.5.3",
"gulp-livereload": "^2.0.0",
"gulp-load-plugins": "^0.5.0",
"gulp-ng-annotate": "^0.3.3",<% if (answers.includeSass) { %>
"gulp-ng-annotate": "^0.3.3",
"gulp-plumber": "^0.6.3",
"gulp-ruby-sass": "^0.5.0",<% } %>
"gulp-ruby-sass": "^0.5.0",
"gulp-shell": "^0.2.9",
"gulp-size": "^0.4.0",
"gulp-uglify": "^0.3.0",
Expand Down
29 changes: 0 additions & 29 deletions app/templates/main.css

This file was deleted.

0 comments on commit ee920a2

Please sign in to comment.