Last active
August 29, 2015 14:02
-
-
Save krisselden/56525b5e8ce68eca0734 to your computer and use it in GitHub Desktop.
Export a tree externally while passing it through.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rimraf = require('rimraf'); | |
var helpers = require('broccoli-kitchen-sink-helpers'); | |
function TeeTree(inputTree, otherDir) { | |
this.inputTree = inputTree; | |
this.otherDir = otherDir; | |
} | |
TeeTree.prototype.read = function (readTree) { | |
var otherDir = this.otherDir; | |
return readTree(this.inputTree).then(function (srcDir) { | |
rimraf.sync(otherDir); | |
helpers.copyRecursivelySync(srcDir, otherDir); | |
return srcDir; // passthrough | |
}); | |
}; | |
TeeTree.prototype.cleanup = function () {}; | |
module.exports = TeeTree; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment