Skip to content

Commit 9fe54c7

Browse files
committed
feat: implement json flag support
1 parent 0331c05 commit 9fe54c7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

packages/cli/src/version/handler.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ const workflowVersionHandler = async (
3333
logger.error('No workflow available');
3434
return;
3535
}
36-
const final = Array.from(output.entries())
37-
.map(([key, value]) => key + '\n' + value)
38-
.join('\n\n');
36+
37+
let final: string;
38+
if (options.json) {
39+
final = JSON.stringify(Object.fromEntries(output), undefined, 2);
40+
} else {
41+
final = Array.from(output.entries())
42+
.map(([key, value]) => key + '\n' + value)
43+
.join('\n\n');
44+
}
3945
logger.success(`Workflow(s) and their hashes\n\n${final}`);
4046
};
4147

0 commit comments

Comments
 (0)