Skip to content

Commit

Permalink
fix(gen): Fixed jshint errors that were breaking grunt command
Browse files Browse the repository at this point in the history
  • Loading branch information
DaftMonk committed Nov 23, 2013
1 parent 2ce0004 commit c6ae81c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Generator.prototype.packageFiles = function () {
Generator.prototype.imageFiles = function () {
this.sourceRoot(path.join(__dirname, 'templates'));
this.directory('images', 'app/images', true);
}
};

Generator.prototype.serverFiles = function () {
this.template('../../templates/express/server.js', 'server.js');
Expand Down
2 changes: 1 addition & 1 deletion script-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Generator.prototype.htmlTemplate = function (src, dest) {
Generator.prototype.addScriptToIndex = function (script) {
try {
var appPath = this.env.options.appPath;
var fullPath = path.join(appPath, 'index.html');
var fullPath = path.join(appPath, 'views', 'index.html');
angularUtils.rewriteFile({
file: fullPath,
needle: '<!-- endbuild -->',
Expand Down
51 changes: 24 additions & 27 deletions templates/common/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ module.exports = function (grunt) {
views: 'views'
},
express: {
options: {
port: process.env.PORT || 9000
},
dev: {
options: {
port: process.env.PORT || 9000
},
dev: {
options: {
script: 'server.js'
}
},
prod: {
options: {
script: 'server.js',
node_env: 'production'
}
script: 'server.js'
}
},
prod: {
options: {
script: 'server.js',
node_env: 'production'
}
}
},
open: {
server: {
Expand Down Expand Up @@ -79,15 +79,15 @@ module.exports = function (grunt) {
}
},
express: {
files: [
'server.js',
'lib/{,*//*}*.{js,json}'
],
tasks: ['express:dev'],
options: {
livereload: true,
nospawn: true //Without this option specified express won't be reloaded
}
files: [
'server.js',
'lib/{,*//*}*.{js,json}'
],
tasks: ['express:dev'],
options: {
livereload: true,
nospawn: true //Without this option specified express won't be reloaded
}
},
styles: {
files: ['<%%= yeoman.app %>/styles/{,*/}*.css'],
Expand All @@ -98,16 +98,13 @@ module.exports = function (grunt) {
}
},

// The actual grunt server settings

// Make sure code styles are up to par and there are no obvious mistakes
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: [
'Gruntfile.js'<% if (!coffee) { %>,
all: [<% if (!coffee) { %>
'<%%= yeoman.app %>/scripts/{,*/}*.js'<% } %>
]<% if (!coffee) { %>,
test: {
Expand Down Expand Up @@ -137,10 +134,10 @@ module.exports = function (grunt) {
src: [
'heroku/*',
'!heroku/.git*',
'!heroku/Procfile'
'!heroku/Procfile'
]
}]
},
},
server: '.tmp'
},

Expand Down
3 changes: 2 additions & 1 deletion templates/express/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
var path = require('path');

exports.partials = function(req, res) {
var requestedView = path.join('./', req.url);
var stripped = req.url.split('.')[0];
var requestedView = path.join('./', stripped);
res.render(requestedView, function(err, html) {
if(err) {
res.render('404');
Expand Down
2 changes: 1 addition & 1 deletion templates/javascript/spec/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Controller: <%= classedName %>Ctrl', function () {
beforeEach(inject(function (_$httpBackend_, $controller, $rootScope) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/awesomeThings')
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
scope = $rootScope.$new();
<%= classedName %>Ctrl = $controller('<%= classedName %>Ctrl', {
$scope: scope
Expand Down

0 comments on commit c6ae81c

Please sign in to comment.