Commit 4779d70c by Andrew Nesbitt

Merge pull request #100 from nyteshade/master

Cleaner, non-breaking, path handling for source and destination with a shared root
parents 19909720 2fe930f3
......@@ -64,6 +64,8 @@ module.exports = function(options){
? options.dest
: src;
var root = options.root || null;
// Default compile callback
options.compile = options.compile || function(){
return sass
......@@ -76,7 +78,15 @@ module.exports = function(options){
if (/\.css$/.test(path)) {
var cssPath = join(dest, path)
, sassPath = join(src, path.replace('.css', '.scss'))
, sassDir = dirname(sassPath)
, sassDir = dirname(sassPath);
if (root) {
cssPath = join(root, dest, path.replace(dest, ''));
sassPath = join(root, src, path
.replace(dest, '')
.replace('.css', '.scss'));
sassDir = dirname(sassPath);
}
if (debug) {
log('source', sassPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment