Skip to content

Commit

Permalink
fix: missing parent dirs created in move
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelDeimos committed Jan 13, 2025
1 parent 6f4b1bf commit 9d9d97f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/backend/src/filesystem/hl_operations/hl_move.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class HLMove extends HLFilesystemOperation {
static MODULES = {
_path: require('path'),
}

static PROPERTIES = {
parent_directories_created: () => [],
}

async _run () {
const { _path } = this.modules;

Expand Down Expand Up @@ -82,6 +87,8 @@ class HLMove extends HLFilesystemOperation {
tree: [parent.path],
});

this.parent_directories_created = tree_op.directories_created;

parent = tree_op.leaves[0];
}

Expand Down Expand Up @@ -187,11 +194,19 @@ class HLMove extends HLFilesystemOperation {
await source_new.awaitStableEntry();
await source_new.fetchSuggestedApps();
await source_new.fetchOwner();
return {

const response = {
moved: await source_new.getSafeEntry({ thumbnail: true }),
overwritten,
old_path,
}

response.parent_dirs_created = [];
for ( const node of this.parent_directories_created ) {
response.parent_dirs_created.push(await node.getSafeEntry());
}

return response;
}
}

Expand Down

0 comments on commit 9d9d97f

Please sign in to comment.