Skip to content

Commit 9e7625c

Browse files
committed
More tweaks
1 parent bf7cf9c commit 9e7625c

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Gruntfile.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,10 @@ module.exports = (grunt) => {
119119
nodeunit: {
120120
tests: ['test/test.js'],
121121
},
122-
123122
})
124123

125124
grunt.loadTasks('tasks')
126125

127126
grunt.registerTask('test', ['clean', 'postcss', 'nodeunit'])
128127
grunt.registerTask('default', ['jshint', 'test'])
129-
}
128+
}

tasks/postcss.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = (grunt) => {
121121
return options.sequential ? runSequence() : Promise.all(tasks)
122122
}
123123

124-
grunt.registerMultiTask('postcss', 'Process CSS files.', function() {
124+
grunt.registerMultiTask('postcss', 'Process CSS files.', function () {
125125
options = this.options({
126126
processors: [],
127127
map: false,
@@ -146,7 +146,7 @@ module.exports = (grunt) => {
146146
postcss(options.processors.call()) :
147147
postcss(options.processors)
148148

149-
this.files.forEach((f) => {
149+
for (const f of this.files) {
150150
const src = f.src.filter((filepath) => {
151151
if (!grunt.file.exists(filepath)) {
152152
grunt.log.error('Source file \x1b[33m%s\x1b[0m not found.', filepath)
@@ -160,7 +160,8 @@ module.exports = (grunt) => {
160160
if (src.length === 0) {
161161
grunt.log.error('\x1b[31mNo source files were found.\x1b[0m')
162162

163-
return done()
163+
done()
164+
continue
164165
}
165166

166167
Array.prototype.push.apply(tasks, src.map((filepath) => {
@@ -208,7 +209,7 @@ module.exports = (grunt) => {
208209
}
209210
})
210211
}))
211-
})
212+
}
212213

213214
runTasks().then(() => {
214215
if (tally.sheets) {

test/test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const fileExists = async (file) => {
3232
}
3333

3434
exports.gruntPostcss = {
35-
3635
defaults: async (test) => {
3736
const actual = {
3837
css: await readFile('tmp/defaults.css', 'utf8'),
@@ -163,4 +162,4 @@ exports.gruntPostcss = {
163162
test.strictEqual(actual, expected)
164163
test.done()
165164
},
166-
}
165+
}

0 commit comments

Comments
 (0)