Skip to content

Commit c6ae81c

Browse files
committed
fix(gen): Fixed jshint errors that were breaking grunt command
1 parent 2ce0004 commit c6ae81c

File tree

5 files changed

+29
-31
lines changed

5 files changed

+29
-31
lines changed

Diff for: app/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ Generator.prototype.packageFiles = function () {
316316
Generator.prototype.imageFiles = function () {
317317
this.sourceRoot(path.join(__dirname, 'templates'));
318318
this.directory('images', 'app/images', true);
319-
}
319+
};
320320

321321
Generator.prototype.serverFiles = function () {
322322
this.template('../../templates/express/server.js', 'server.js');

Diff for: script-base.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Generator.prototype.htmlTemplate = function (src, dest) {
9292
Generator.prototype.addScriptToIndex = function (script) {
9393
try {
9494
var appPath = this.env.options.appPath;
95-
var fullPath = path.join(appPath, 'index.html');
95+
var fullPath = path.join(appPath, 'views', 'index.html');
9696
angularUtils.rewriteFile({
9797
file: fullPath,
9898
needle: '<!-- endbuild -->',

Diff for: templates/common/Gruntfile.js

+24-27
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ module.exports = function (grunt) {
2626
views: 'views'
2727
},
2828
express: {
29+
options: {
30+
port: process.env.PORT || 9000
31+
},
32+
dev: {
2933
options: {
30-
port: process.env.PORT || 9000
31-
},
32-
dev: {
33-
options: {
34-
script: 'server.js'
35-
}
36-
},
37-
prod: {
38-
options: {
39-
script: 'server.js',
40-
node_env: 'production'
41-
}
34+
script: 'server.js'
35+
}
36+
},
37+
prod: {
38+
options: {
39+
script: 'server.js',
40+
node_env: 'production'
4241
}
42+
}
4343
},
4444
open: {
4545
server: {
@@ -79,15 +79,15 @@ module.exports = function (grunt) {
7979
}
8080
},
8181
express: {
82-
files: [
83-
'server.js',
84-
'lib/{,*//*}*.{js,json}'
85-
],
86-
tasks: ['express:dev'],
87-
options: {
88-
livereload: true,
89-
nospawn: true //Without this option specified express won't be reloaded
90-
}
82+
files: [
83+
'server.js',
84+
'lib/{,*//*}*.{js,json}'
85+
],
86+
tasks: ['express:dev'],
87+
options: {
88+
livereload: true,
89+
nospawn: true //Without this option specified express won't be reloaded
90+
}
9191
},
9292
styles: {
9393
files: ['<%%= yeoman.app %>/styles/{,*/}*.css'],
@@ -98,16 +98,13 @@ module.exports = function (grunt) {
9898
}
9999
},
100100

101-
// The actual grunt server settings
102-
103101
// Make sure code styles are up to par and there are no obvious mistakes
104102
jshint: {
105103
options: {
106104
jshintrc: '.jshintrc',
107105
reporter: require('jshint-stylish')
108106
},
109-
all: [
110-
'Gruntfile.js'<% if (!coffee) { %>,
107+
all: [<% if (!coffee) { %>
111108
'<%%= yeoman.app %>/scripts/{,*/}*.js'<% } %>
112109
]<% if (!coffee) { %>,
113110
test: {
@@ -137,10 +134,10 @@ module.exports = function (grunt) {
137134
src: [
138135
'heroku/*',
139136
'!heroku/.git*',
140-
'!heroku/Procfile'
137+
'!heroku/Procfile'
141138
]
142139
}]
143-
},
140+
},
144141
server: '.tmp'
145142
},
146143

Diff for: templates/express/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
var path = require('path');
44

55
exports.partials = function(req, res) {
6-
var requestedView = path.join('./', req.url);
6+
var stripped = req.url.split('.')[0];
7+
var requestedView = path.join('./', stripped);
78
res.render(requestedView, function(err, html) {
89
if(err) {
910
res.render('404');

Diff for: templates/javascript/spec/controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('Controller: <%= classedName %>Ctrl', function () {
1313
beforeEach(inject(function (_$httpBackend_, $controller, $rootScope) {
1414
$httpBackend = _$httpBackend_;
1515
$httpBackend.expectGET('/api/awesomeThings')
16-
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
16+
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
1717
scope = $rootScope.$new();
1818
<%= classedName %>Ctrl = $controller('<%= classedName %>Ctrl', {
1919
$scope: scope

0 commit comments

Comments
 (0)