Skip to content

Instantly share code, notes, and snippets.

@krisselden
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisselden/56525b5e8ce68eca0734 to your computer and use it in GitHub Desktop.
Save krisselden/56525b5e8ce68eca0734 to your computer and use it in GitHub Desktop.
Export a tree externally while passing it through.
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