From ab5ded03cf27293ab8e38002126b4154c28a25cf Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Tue, 25 Apr 2023 22:33:52 -0400 Subject: [PATCH] fix(striker-ui-api): add label to stdoutVar, simplify uuidgen --- striker-ui-api/src/lib/shell.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/striker-ui-api/src/lib/shell.ts b/striker-ui-api/src/lib/shell.ts index 5529bbed..ffff8a7c 100644 --- a/striker-ui-api/src/lib/shell.ts +++ b/striker-ui-api/src/lib/shell.ts @@ -58,5 +58,7 @@ export const stderr = (message: string) => print(message, { stream: 'stderr' }); export const stdout = (message: string) => print(message); -export const stdoutVar = (variable: { [name: string]: unknown }) => - print(`Variables: ${JSON.stringify(variable, null, 2)}`); +export const stdoutVar = (variable: unknown, label = 'Variables: ') => + print(`${label}${JSON.stringify(variable, null, 2)}`); + +export const uuid = () => uuidgen('--random').trim();