Skip to content

Commit

Permalink
Fixed the '_delete' method in the 'VirtualFileSystem' class which was…
Browse files Browse the repository at this point in the history
… not deleting the children of deleted folders
  • Loading branch information
AdrienCastex committed Jun 28, 2017
1 parent 0b41e28 commit e529f71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/manager/v2/instances/VirtualFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ var VirtualFileSystem = (function (_super) {
callback();
};
VirtualFileSystem.prototype._delete = function (path, ctx, callback) {
delete this.resources[path.toString()];
var sPath = path.toString();
for (var path_1 in this.resources)
if (path_1.indexOf(sPath) === 0)
delete this.resources[path_1];
callback();
};
VirtualFileSystem.prototype._openWriteStream = function (path, ctx, callback) {
Expand Down
6 changes: 5 additions & 1 deletion src/manager/v2/instances/VirtualFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ export class VirtualFileSystem extends FileSystem

protected _delete(path : Path, ctx : DeleteInfo, callback : SimpleCallback) : void
{
delete this.resources[path.toString()];
const sPath = path.toString();
for(const path in this.resources)
if(path.indexOf(sPath) === 0)
delete this.resources[path];

callback();
}

Expand Down

0 comments on commit e529f71

Please sign in to comment.