feat(doi): add DOI-based path access for commands
Support accessing repositories using DOI strings with optional subpaths
across ls, download, metadata, and file-metadata commands.
- Implement GET v3/doi/{id}/ API model and client calls
- Parse and resolve DOI paths into respective folder and files
- Extract common folder and file resolution logic to shared helpers
- Update README with example DOI-based shell commands
This commit is contained in:
@@ -54,9 +54,11 @@ class LsCommand(BaseCommand):
|
||||
|
||||
@classmethod
|
||||
def ls(cls, remote_path: str, password: str | None, is_json: bool, is_recursive: bool, is_quiet: bool) -> None:
|
||||
(remote, laboratory_name, r_path) = cls._parse_remote_host_with_path(remote_path)
|
||||
remote = remote_path.split(":", 1)[0] if ":" in remote_path else ""
|
||||
connection = cls._create_connection(remote)
|
||||
laboratory = cls._find_laboratory(connection, laboratory_name)
|
||||
folder, laboratory = cls._resolve_folder(connection, remote_path, password)
|
||||
laboratory_name = laboratory.name
|
||||
files = cls._find_files(connection, folder.id)
|
||||
context = LsCommandContext(
|
||||
f"{remote}:/{laboratory_name}",
|
||||
connection,
|
||||
@@ -66,8 +68,6 @@ class LsCommand(BaseCommand):
|
||||
is_quiet,
|
||||
is_recursive,
|
||||
)
|
||||
folder = cls._find_folder(connection, laboratory, r_path, password)
|
||||
files = cls._find_files(connection, folder.id)
|
||||
if context.is_json:
|
||||
cls._ls_json(context, folder, files)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user