修复--auth-stdin读取失败的bug
This commit is contained in:
@@ -8,14 +8,24 @@ from .core import DEFAULT_TIMEOUT, build_runtime_context, emit_success, request_
|
||||
|
||||
|
||||
def runtime_context(ctx: typer.Context):
|
||||
obj = ctx.obj or {}
|
||||
return build_runtime_context(
|
||||
obj = ctx.obj
|
||||
if not isinstance(obj, dict):
|
||||
obj = {}
|
||||
ctx.obj = obj
|
||||
|
||||
cached_runtime = obj.get("_runtime_context")
|
||||
if cached_runtime is not None:
|
||||
return cached_runtime
|
||||
|
||||
runtime = build_runtime_context(
|
||||
server=obj.get("server"),
|
||||
auth_stdin=obj.get("auth_stdin", False),
|
||||
scheme=obj.get("scheme"),
|
||||
timeout=obj.get("timeout", DEFAULT_TIMEOUT),
|
||||
request_id=obj.get("request_id"),
|
||||
)
|
||||
obj["_runtime_context"] = runtime
|
||||
return runtime
|
||||
|
||||
|
||||
def emit_api(
|
||||
|
||||
Reference in New Issue
Block a user