Skip to content

Commit

Permalink
Merge pull request #86 from 3on/fs-root
Browse files Browse the repository at this point in the history
Add missing methods in fs-root
  • Loading branch information
kriskowal committed Feb 27, 2014
2 parents 92f0784 + 6c4b09d commit dedef6a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions fs-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,30 @@ function RootFs(outer, root) {
});
};

inner.remove = function (path) {
return attenuate(path).then(function (path) {
return outer.remove(path.outer);
}).catch(function (error) {
throw new Error("Can't remove " + JSON.stringify(path));
});
};

inner.makeTree = function (path) {
return attenuate(path).then(function (path) {
return outer.makeTree(path.outer);
}).catch(function (error) {
throw new Error("Can't make tree " + JSON.stringify(path));
});
};

inner.removeTree = function (path) {
return attenuate(path).then(function (path) {
return outer.removeTree(path.outer);
}).catch(function (error) {
throw new Error("Can't remove tree " + JSON.stringify(path));
});
};

return Q.when(outer.canonical(root), function (_root) {
root = _root;
return inner;
Expand Down

0 comments on commit dedef6a

Please sign in to comment.