Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Same directory generation
Browse files Browse the repository at this point in the history
  • Loading branch information
thepian committed Jul 18, 2013
1 parent 22552f5 commit 8ea5f42
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/refreshing/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,11 @@ SourceNode.prototype.generateCopy = function() {
//console.log("inPath",this.tree.rootPrefix,"." + this.childPath().join(path.sep));
var inPath = path.resolve(this.tree.rootPrefix,"." + this.childPath().join(path.sep));
for(var n in this.config.outputs) {
var outPath = this.config.outputs[n].resolve(this.childPath().join(path.sep));
fs.copy(inPath,outPath);
var output = this.config.outputs[n];
if (! output.same) {
var outPath = output.resolve(this.childPath().join(path.sep));
fs.copy(inPath,outPath);
}
//console.log("Copying ",inPath,"to",outPath,this.name);
}
};
Expand Down Expand Up @@ -722,12 +725,13 @@ SourceNode.prototype["ext .svg"] = function() {
function SiteOutput(config,prefix) {
//console.log("output prefix",config.rootPath.join(path.sep),prefix);

this.rootPrefix = path.resolve(config.rootPrefix,prefix);
this.rootPrefix = !prefix? config.rootPrefix : path.resolve(config.rootPrefix,prefix);
this.same = config.rootPrefix == this.rootPrefix;
this.rootPath = this.rootPrefix.split(path.sep);
// for(var i=0,n; n = this.rootPath[i]; ++i) {
// fs.mkdirSync(path.dirname(pth));
// }
//console.log("site output prefix",this.rootPrefix);
// console.log("site output prefix",this.rootPrefix);
}

SiteOutput.prototype.resolve = function(name) {
Expand Down Expand Up @@ -868,6 +872,9 @@ SiteConfig.prototype._configOutput = function() {
case "string":
this.outputs[this.destination] = new SiteOutput(this,this.destination);
break;
case "undefined":
this.outputs[this.destination] = new SiteOutput(this,".");
break;
}
};

Expand Down

0 comments on commit 8ea5f42

Please sign in to comment.