@@ -5,7 +5,7 @@ import { Global } from "@opencode/util/global"
55import { AppProcess } from "@opencode/util/process"
66import { expect , spyOn , test } from "bun:test"
77import { Effect , FileSystem , Layer , PlatformError , Stream } from "effect"
8- import { ChildProcess , ChildProcessSpawner } from "effect/process"
8+ import { ChildProcessSpawner } from "effect/process"
99import { existsSync , readdirSync , readFileSync } from "node:fs"
1010import path from "node:path"
1111import { Updater } from "../src/services/updater"
@@ -16,7 +16,10 @@ const it = testEffect(NodeServices.layer)
1616declare const OPENCODE_CLI_NAME : string | undefined
1717
1818function fixture (
19- respond : ( command : ChildProcess . StandardCommand ) => Partial < AppProcess . RunResult > & {
19+ respond : ( command : {
20+ readonly command : string
21+ readonly args : ReadonlyArray < string >
22+ } ) => Partial < AppProcess . RunResult > & {
2023 error ?: AppProcess . AppProcessError
2124 } = ( ) => ( { } ) ,
2225 name = "@opencode/cli" ,
@@ -110,11 +113,12 @@ function fixture(
110113 run : ( command ) =>
111114 Effect . suspend ( ( ) => {
112115 if ( command . _tag !== "StandardCommand" ) return Effect . die ( "Unexpected piped install command" )
113- const lookup = command . command === "git" && command . args [ 0 ] === "--exec-path"
114- if ( ! lookup ) commands . push ( [ command . command , ...command . args ] )
116+ const args = command . args . map ( String )
117+ const lookup = command . command === "git" && args [ 0 ] === "--exec-path"
118+ if ( ! lookup ) commands . push ( [ command . command , ...args ] )
115119 const result = lookup
116120 ? { stdout : Buffer . from ( `${ path . join ( git , "mingw64" , "libexec" , "git-core" ) } \n` ) }
117- : respond ( command )
121+ : respond ( { command : command . command , args } )
118122 if ( result . error ) return Effect . fail ( result . error )
119123 return Effect . succeed ( {
120124 command : command . command ,
0 commit comments