Skip to content

Commit

Permalink
Fixed loop error and updated readme.md
Browse files Browse the repository at this point in the history
Fixed incorrect counter reference in loop.
Updated README.md reflecting correct usage.
  • Loading branch information
midnight-coding committed Mar 14, 2019
1 parent c668726 commit ed1bc54
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
62 changes: 33 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ In your project's Gruntfile, add a section named `cacheKiller` to the data objec
```js
grunt.initConfig({
cacheKiller: {
taskName: {
options: {
// Options
},
files: {
// Asset filename : // Template filename(s)
},
},
taskName: {
files: {
'asset/path/filename.css': ['template/path/filename-1.html', 'template/path/filename-2.html']
}
}
}
});
```

Expand Down Expand Up @@ -78,18 +80,18 @@ In this example, the default options are used.
```js
grunt.initConfig({
cacheKiller: {
options: {
prepend: '',
append: '',
mask: '{md5}',
length: -1
},
taskName: {
options: {
prepend: '',
append: '',
mask: '{md5}',
length: -1
},
files: {
'public/css/app[mask].min.css': 'app/views/templates/master.html',
},
},
},
'public/css/app[mask].min.css': ['app/views/templates/master.html']
}
}
}
});
```

Expand Down Expand Up @@ -128,19 +130,19 @@ In this example, custom options are used
```js
grunt.initConfig({
cacheKiller: {
options: {
prepend: '-',
append: '.dev',
mask: '{md5}',
length: 8
},
taskName: {
options: {
prepend: '-',
append: '.dev',
mask: '{md5}',
length: 8
},
files: {
'public/css/app[mask].min.css': 'app/views/templates/master.html',
'public/js/app[mask].min.js': 'app/views/templates/master.html'
},
},
},
'public/css/app[mask].min.css': ['app/views/templates/master.html'],
'public/js/app[mask].min.js': ['app/views/templates/master.html']
}
}
}
});
```

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

## Release History

| Date | Version | Comments |
| :--------: | :-----: | :---------------|
| 01-03-2019 | 1.0.0 | Initial commit. |
| Date | Version | Comments |
| :--------: | :-----: | :-------------------------------------------|
| 01-03-2019 | 1.0.0 | Initial commit. |
| 14-03-2019 | 1.0.1 | Fixed incorrect counter reference in loop. |
| | | Updated README.md reflecting correct usage. |
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-cache-killer",
"description": "Kill your asset cache file problems by updating their filenames and any references to them.",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/midnight-coding/grunt-cache-killer",
"author": {
"name": "Matthew Rath",
Expand Down
2 changes: 1 addition & 1 deletion tasks/cacheKiller.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = function (grunt) {
// Check if the template file(s) exist.
for (var k = 0; k < $tasks[j].templates.length; k++) {
if (!fileSystem.existsSync($tasks[j].templates[k])) {
grunt.fail.warn('cacheKiller -> ' + this.target + ' : The template file \'' + $tasks[i].templates[k] + '\' does not exist.');
grunt.fail.warn('cacheKiller -> ' + this.target + ' : The template file \'' + $tasks[j].templates[k] + '\' does not exist.');
}
}

Expand Down

0 comments on commit ed1bc54

Please sign in to comment.