mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-05 17:10:45 +00:00
clean: remove dead code in hl_mkdir
Remove a method in hl_mkdir which was determined to not be referred to anywhere. hl_mkdir was re-tested to verify that this did not cause a regression.
This commit is contained in:
@@ -435,33 +435,6 @@ class HLMkdir extends HLFilesystemOperation {
|
||||
return tree_op.leaves[0];
|
||||
}
|
||||
|
||||
async _get_existing_parent ({ parent_node }) {
|
||||
const { context, values } = this;
|
||||
const { _path } = this.modules;
|
||||
const fs = context.get('services').get('filesystem');
|
||||
|
||||
const target_dirname = _path.dirname(values.path);
|
||||
const dirs = target_dirname === '.' ? []
|
||||
: target_dirname.split('/').filter(Boolean);
|
||||
|
||||
let current = parent_node.selector;
|
||||
for ( let i = 0 ; i < dirs.length ; i++ ) {
|
||||
current = new NodeChildSelector(current, dirs[i]);
|
||||
}
|
||||
|
||||
const node = await fs.node(current);
|
||||
|
||||
if ( ! await node.exists() ) {
|
||||
throw APIError.create('dest_does_not_exist');
|
||||
}
|
||||
|
||||
if ( ! node.entry.is_dir ) {
|
||||
throw APIError.create('dest_is_not_a_directory');
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a directory and all its ancestors.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user