From ef3447dac8d835c997d0ec6b2edb9190b2c4464a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 30 Jul 2023 11:25:11 +0200 Subject: [PATCH] fix silent on flow run --- cli/flow.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/cli/flow.ts b/cli/flow.ts index 42c81b9aff..5d0a02c92d 100644 --- a/cli/flow.ts +++ b/cli/flow.ts @@ -1,6 +1,6 @@ // deno-lint-ignore-file no-explicit-any import { GlobalOptions, isSuperset } from "./types.ts"; - +import { log } from "./deps.ts"; import { colors, Command, @@ -68,10 +68,10 @@ export async function pushFlow( if (flow) { if (isSuperset(localFlow, flow)) { - console.log(colors.bold.green("Flow is up to date")); + log.info(colors.bold.green("Flow is up to date")); return; } - console.log(colors.bold.yellow(`Updating flow ${remotePath}...`)); + log.info(colors.bold.yellow(`Updating flow ${remotePath}...`)); await FlowService.updateFlow({ workspace: workspace, path: remotePath, @@ -81,7 +81,7 @@ export async function pushFlow( }, }); } else { - console.log(colors.bold.yellow("Creating new flow...")); + log.info(colors.bold.yellow("Creating new flow...")); await FlowService.createFlow({ workspace: workspace, requestBody: { @@ -102,7 +102,7 @@ async function push(opts: Options, filePath: string, remotePath: string) { await requireLogin(opts); await pushFlow(workspace.workspaceId, remotePath, filePath); - console.log(colors.bold.underline.green("Flow pushed")); + log.info(colors.bold.underline.green("Flow pushed")); } async function list(opts: GlobalOptions & { showArchived?: boolean }) { @@ -164,11 +164,13 @@ async function run( if (module.job) { if (!opts.silent) { - console.log("====== Job " + (i + 1) + " ======"); + log.info("====== Job " + (i + 1) + " ======"); await track_job(workspace.workspaceId, module.job); } } else { - console.log(module.type); + if (!opts.silent) { + log.info(module.type); + } await new Promise((resolve, _) => setTimeout(() => resolve(undefined), 100) ); @@ -178,14 +180,14 @@ async function run( } if (!opts.silent) { - console.log(colors.green.underline.bold("Flow ran to completion")); - console.log(); + log.info(colors.green.underline.bold("Flow ran to completion")); + log.info("\n"); } const jobInfo = await JobService.getCompletedJob({ workspace: workspace.workspaceId, id, }); - console.log(jobInfo.result ?? {}); + log.info(jobInfo.result ?? {}); } const command = new Command()