@@ -7,7 +7,7 @@ import { spawn } from "node:child_process";
77import { TUIService } from "../tui/service.js" ;
88import type { ExecutionService } from "./api.js" ;
99import { ExecutionError , ScriptExecutionError } from "./errors.js" ;
10- import { spawnEffect , withSpinner } from "./helpers.js" ;
10+ import { shouldRenderProgress , spawnEffect , withSpinner } from "./helpers.js" ;
1111import type { ExecutionOptions } from "./types.js" ;
1212
1313/**
@@ -25,24 +25,25 @@ export class Execution extends Effect.Service<Execution>()("Execution", {
2525 ) =>
2626 Effect . gen ( function * ( ) {
2727 const task = spawnEffect ( scriptPath , options ) ;
28-
29- // Try to use TUI spinner if available
30- // biome-ignore lint/suspicious/noExplicitAny: Dynamic TUI module shape varies at runtime
31- const tui = yield * tuiService . load ( ) . pipe ( Effect . catchAll ( ( ) => Effect . succeed ( null ) ) ) as Effect . Effect < Record < string , any > | null > ;
32- if ( tui ?. InkService && tui ?. spinnerEffect ) {
33- const maybeInk = yield * Effect . serviceOption ( tui . InkService ) ;
34- if ( Opt . isSome ( maybeInk ) && ! options ?. verbose ) {
35- // Use TUI spinner
36- yield * ( tui . spinnerEffect ( taskName , task , {
37- type : "dots" ,
38- color : "cyan" ,
39- } ) as Effect . Effect < void , ExecutionError > ) ;
40- return ;
28+ const showProgress = shouldRenderProgress ( options ) ;
29+
30+ if ( showProgress ) {
31+ // Try to use TUI spinner if available
32+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic TUI module shape varies at runtime
33+ const tui = yield * tuiService . load ( ) . pipe ( Effect . catchAll ( ( ) => Effect . succeed ( null ) ) ) as Effect . Effect < Record < string , any > | null > ;
34+ if ( tui ?. InkService && tui ?. spinnerEffect ) {
35+ const maybeInk = yield * Effect . serviceOption ( tui . InkService ) ;
36+ if ( Opt . isSome ( maybeInk ) ) {
37+ // Use TUI spinner
38+ yield * ( tui . spinnerEffect ( taskName , task , {
39+ type : "dots" ,
40+ color : "cyan" ,
41+ } ) as Effect . Effect < void , ExecutionError > ) ;
42+ return ;
43+ }
4144 }
42- }
4345
44- // Fallback to console with ora-style output
45- if ( ! options ?. verbose ) {
46+ // Fallback to console with ora-style output
4647 yield * Console . log ( `⣾ ${ taskName } ...` ) ;
4748 }
4849
@@ -64,7 +65,7 @@ export class Execution extends Effect.Service<Execution>()("Execution", {
6465 } )
6566 ) ;
6667
67- if ( ! options ?. verbose ) {
68+ if ( showProgress ) {
6869 yield * Console . log ( `✓ ${ taskName } completed` ) ;
6970 }
7071 } ) ;
0 commit comments