Skip to content

Commit ed1bc54

Browse files
Fixed loop error and updated readme.md
Fixed incorrect counter reference in loop. Updated README.md reflecting correct usage.
1 parent c668726 commit ed1bc54

File tree

3 files changed

+35
-31
lines changed

3 files changed

+35
-31
lines changed

README.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ In your project's Gruntfile, add a section named `cacheKiller` to the data objec
3535
```js
3636
grunt.initConfig({
3737
cacheKiller: {
38-
taskName: {
38+
options: {
3939
// Options
4040
},
41-
files: {
42-
// Asset filename : // Template filename(s)
43-
},
44-
},
41+
taskName: {
42+
files: {
43+
'asset/path/filename.css': ['template/path/filename-1.html', 'template/path/filename-2.html']
44+
}
45+
}
46+
}
4547
});
4648
```
4749

@@ -78,18 +80,18 @@ In this example, the default options are used.
7880
```js
7981
grunt.initConfig({
8082
cacheKiller: {
83+
options: {
84+
prepend: '',
85+
append: '',
86+
mask: '{md5}',
87+
length: -1
88+
},
8189
taskName: {
82-
options: {
83-
prepend: '',
84-
append: '',
85-
mask: '{md5}',
86-
length: -1
87-
},
8890
files: {
89-
'public/css/app[mask].min.css': 'app/views/templates/master.html',
90-
},
91-
},
92-
},
91+
'public/css/app[mask].min.css': ['app/views/templates/master.html']
92+
}
93+
}
94+
}
9395
});
9496
```
9597

@@ -128,19 +130,19 @@ In this example, custom options are used
128130
```js
129131
grunt.initConfig({
130132
cacheKiller: {
133+
options: {
134+
prepend: '-',
135+
append: '.dev',
136+
mask: '{md5}',
137+
length: 8
138+
},
131139
taskName: {
132-
options: {
133-
prepend: '-',
134-
append: '.dev',
135-
mask: '{md5}',
136-
length: 8
137-
},
138140
files: {
139-
'public/css/app[mask].min.css': 'app/views/templates/master.html',
140-
'public/js/app[mask].min.js': 'app/views/templates/master.html'
141-
},
142-
},
143-
},
141+
'public/css/app[mask].min.css': ['app/views/templates/master.html'],
142+
'public/js/app[mask].min.js': ['app/views/templates/master.html']
143+
}
144+
}
145+
}
144146
});
145147
```
146148

@@ -182,6 +184,8 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
182184

183185
## Release History
184186

185-
| Date | Version | Comments |
186-
| :--------: | :-----: | :---------------|
187-
| 01-03-2019 | 1.0.0 | Initial commit. |
187+
| Date | Version | Comments |
188+
| :--------: | :-----: | :-------------------------------------------|
189+
| 01-03-2019 | 1.0.0 | Initial commit. |
190+
| 14-03-2019 | 1.0.1 | Fixed incorrect counter reference in loop. |
191+
| | | Updated README.md reflecting correct usage. |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-cache-killer",
33
"description": "Kill your asset cache file problems by updating their filenames and any references to them.",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"homepage": "https://github.com/midnight-coding/grunt-cache-killer",
66
"author": {
77
"name": "Matthew Rath",

tasks/cacheKiller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ module.exports = function (grunt) {
208208
// Check if the template file(s) exist.
209209
for (var k = 0; k < $tasks[j].templates.length; k++) {
210210
if (!fileSystem.existsSync($tasks[j].templates[k])) {
211-
grunt.fail.warn('cacheKiller -> ' + this.target + ' : The template file \'' + $tasks[i].templates[k] + '\' does not exist.');
211+
grunt.fail.warn('cacheKiller -> ' + this.target + ' : The template file \'' + $tasks[j].templates[k] + '\' does not exist.');
212212
}
213213
}
214214

0 commit comments

Comments
 (0)