Skip to content

Commit

Permalink
Add 'exclude' option (github volojs#7).
Browse files Browse the repository at this point in the history
  • Loading branch information
cscott committed Feb 9, 2013
1 parent 6ac2b8d commit 9e69d59
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ function frontSlash(path) {
* this module. Note that the template contains some tokens replaced
* by this command.
*
* @param {RegExp or Function} a regular expression (function) matching
* (returning true) additional files to exclude from the appcache.
*
* @return {Object} The volo command.
*/
module.exports = function (options) {
Expand Down Expand Up @@ -164,6 +167,16 @@ module.exports = function (options) {
//Filter out files removed.
return !!file;
});
if (options.exclude) {
// filter out additional files, with a function or regexp
appFiles = appFiles.filter(function(file) {
if (typeof(options.exclude) === 'function') {
return !(options.exclude(file));
} else {
return !file.match(options.exclude);
}
});
}

//If the html file does not already have a manifest attribute,
//add it. Allow for multiple html tags via IE conditional
Expand Down

0 comments on commit 9e69d59

Please sign in to comment.