refactor(hermes_cli): npm_engine/onepassword — fold trivial intermediates
This commit is contained in:
@@ -93,9 +93,7 @@ def _repo_npm_range() -> str | None:
|
||||
except (OSError, ValueError):
|
||||
return None
|
||||
engines = data.get("engines")
|
||||
if not isinstance(engines, dict):
|
||||
return None
|
||||
value = engines.get("npm")
|
||||
value = engines.get("npm") if isinstance(engines, dict) else None
|
||||
return str(value).strip() if value else None
|
||||
|
||||
|
||||
|
||||
@@ -392,5 +392,4 @@ def _op_whoami(binary: Path, account: str, *, token_value: str = "") -> Optional
|
||||
return None
|
||||
if res.returncode != 0:
|
||||
return None
|
||||
out = (res.stdout or "").strip()
|
||||
return out.replace("\n", " ")[:120] or "authenticated"
|
||||
return (res.stdout or "").strip().replace("\n", " ")[:120] or "authenticated"
|
||||
|
||||
Reference in New Issue
Block a user