This commit is contained in:
Ben Zörb 2014-11-25 17:21:43 +01:00
parent 4b30bf5fda
commit f8eed5b561
2 changed files with 11 additions and 2 deletions

View File

@ -16,6 +16,14 @@ var cave = require('cave');
var reaver = require('reaver');
var cheerio = require('cheerio');
var CleanCSS = require('clean-css');
var slash = require('slash');
/**
* Fixup slashes in file paths for windows
*/
function normalizePath(str) {
return process.platform === 'win32' ? slash(str) : str;
}
module.exports = function(html, styles, options) {
@ -50,7 +58,7 @@ module.exports = function(html, styles, options) {
}
var diff = cave(file, { css: styles });
fs.writeFileSync(reaver.rev(file, diff), diff);
return reaver.rev(href, diff);
return reaver.rev(normalizePath(href), diff);
});
}

View File

@ -22,7 +22,8 @@
"cave": "^2.0.0",
"cheerio": "^0.17.0",
"clean-css": "^2.2.12",
"reaver": "^1.2.0"
"reaver": "^1.2.0",
"slash": "^1.0.0"
},
"devDependencies": {
"chai": "~1.8.1",