Skip to content

Commit b1d720c

Browse files
committed
Fix office convert target format in dry-run plan
1 parent 0c54889 commit b1d720c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sourceosctl/commands/office.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ def _sha256(path: Path) -> Optional[str]:
111111
return "sha256:" + digest.hexdigest()
112112

113113

114-
def _artifact_plan(args, operation: str) -> Dict[str, Any]:
114+
def _artifact_plan(args, operation: str, format_override: Optional[str] = None) -> Dict[str, Any]:
115115
artifact_type = getattr(args, "artifact_type", None) or "document"
116-
fmt = getattr(args, "format", None) or "docx"
116+
fmt = format_override or getattr(args, "format", None) or "docx"
117117
title = getattr(args, "title", None) or "Untitled Office Artifact"
118118
workroom_id = getattr(args, "workroom_id", None) or DEFAULT_WORKROOM_ID
119119
output_root = getattr(args, "output_root", None) or DEFAULT_OUTPUT_ROOT
@@ -229,7 +229,7 @@ def convert(args) -> int:
229229
if not getattr(args, "dry_run", True):
230230
print("error: office convert is dry-run only in this release", file=sys.stderr)
231231
return 1
232-
payload = _artifact_plan(args, "convert")
232+
payload = _artifact_plan(args, "convert", format_override=args.to)
233233
payload["conversion"] = {
234234
"input": _redact_home(args.input),
235235
"inputExists": Path(_expand(args.input)).exists(),

0 commit comments

Comments
 (0)