From c8f23514598b6f1fdfd104918237a70f55be58bd Mon Sep 17 00:00:00 2001 From: jeiea Date: Tue, 4 Jun 2024 00:33:17 +0900 Subject: [PATCH] feat: disable spinner on CI --- src/utils/spinner.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/utils/spinner.ts b/src/utils/spinner.ts index cf9ef943..710eeff8 100644 --- a/src/utils/spinner.ts +++ b/src/utils/spinner.ts @@ -1,4 +1,4 @@ -import { Spinner, SpinnerOptions, wait as innerWait } from "../../deps.ts"; +import { cyan, Spinner, type SpinnerOptions } from "../../deps.ts"; let current: Spinner | null = null; @@ -6,8 +6,20 @@ export function wait(param: string | SpinnerOptions) { if (typeof param === "string") { param = { text: param }; } - param.interceptConsole = false; - current = innerWait({ stream: Deno.stderr, ...param }); + + current = new Spinner({ + text: param.text, + prefix: param.prefix ?? "", + color: param.color ?? cyan, + spinner: param.spinner ?? "dots", + hideCursor: param.hideCursor ?? true, + indent: param.indent ?? 0, + interval: param.interval ?? 100, + stream: param.stream ?? Deno.stderr, + enabled: !Deno.env.get("CI"), + discardStdin: true, + interceptConsole: false, + }); return current; }