mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
fix: missing parent dirs created in move
This commit is contained in:
parent
6f4b1bf94a
commit
9d9d97fd00
@ -30,6 +30,11 @@ class HLMove extends HLFilesystemOperation {
|
|||||||
static MODULES = {
|
static MODULES = {
|
||||||
_path: require('path'),
|
_path: require('path'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PROPERTIES = {
|
||||||
|
parent_directories_created: () => [],
|
||||||
|
}
|
||||||
|
|
||||||
async _run () {
|
async _run () {
|
||||||
const { _path } = this.modules;
|
const { _path } = this.modules;
|
||||||
|
|
||||||
@ -82,6 +87,8 @@ class HLMove extends HLFilesystemOperation {
|
|||||||
tree: [parent.path],
|
tree: [parent.path],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.parent_directories_created = tree_op.directories_created;
|
||||||
|
|
||||||
parent = tree_op.leaves[0];
|
parent = tree_op.leaves[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,11 +194,19 @@ class HLMove extends HLFilesystemOperation {
|
|||||||
await source_new.awaitStableEntry();
|
await source_new.awaitStableEntry();
|
||||||
await source_new.fetchSuggestedApps();
|
await source_new.fetchSuggestedApps();
|
||||||
await source_new.fetchOwner();
|
await source_new.fetchOwner();
|
||||||
return {
|
|
||||||
|
const response = {
|
||||||
moved: await source_new.getSafeEntry({ thumbnail: true }),
|
moved: await source_new.getSafeEntry({ thumbnail: true }),
|
||||||
overwritten,
|
overwritten,
|
||||||
old_path,
|
old_path,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
response.parent_dirs_created = [];
|
||||||
|
for ( const node of this.parent_directories_created ) {
|
||||||
|
response.parent_dirs_created.push(await node.getSafeEntry());
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user