update screenshot
This commit is contained in:
@@ -338,6 +338,14 @@ class Add_File(Cmdlet):
|
||||
except Exception:
|
||||
is_storage_backend_location = False
|
||||
|
||||
if location and not plugin_name and not is_storage_backend_location:
|
||||
if not Add_File._looks_like_local_export_target(str(location)):
|
||||
log(
|
||||
f"Storage backend '{location}' not found. Use -path for local export or configure that store backend.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 1
|
||||
|
||||
# Decide which items to process.
|
||||
# - If directory scan was performed, use those results
|
||||
# - If user provided -path (and it was not reinterpreted as destination), treat this invocation as single-item.
|
||||
@@ -1262,6 +1270,27 @@ class Add_File(Cmdlet):
|
||||
pass
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def _looks_like_local_export_target(location: str) -> bool:
|
||||
target = str(location or "").strip()
|
||||
if not target:
|
||||
return False
|
||||
|
||||
target_path = Path(target).expanduser()
|
||||
try:
|
||||
if target_path.exists():
|
||||
return True
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if target.startswith((".", "~")):
|
||||
return True
|
||||
if "\\" in target or "/" in target:
|
||||
return True
|
||||
if len(target) >= 2 and target[1] == ":":
|
||||
return True
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def _resolve_source(
|
||||
result: Any,
|
||||
|
||||
Reference in New Issue
Block a user