refactor(bash): use Effect ChildProcess for bash tool execution (#20496)
This commit is contained in:
@@ -488,3 +488,14 @@ export const layer: Layer.Layer<ChildProcessSpawner, never, FileSystem.FileSyste
|
||||
)
|
||||
|
||||
export const defaultLayer = layer.pipe(Layer.provide(NodeFileSystem.layer), Layer.provide(NodePath.layer))
|
||||
|
||||
import { lazy } from "@/util/lazy"
|
||||
|
||||
const rt = lazy(() => {
|
||||
// Dynamic import to avoid circular dep: cross-spawn-spawner → run-service → Instance → project → cross-spawn-spawner
|
||||
const { makeRuntime } = require("@/effect/run-service") as typeof import("@/effect/run-service")
|
||||
return makeRuntime(ChildProcessSpawner, defaultLayer)
|
||||
})
|
||||
|
||||
export const runPromiseExit: ReturnType<typeof rt>["runPromiseExit"] = (...args) => rt().runPromiseExit(...(args as [any]))
|
||||
export const runPromise: ReturnType<typeof rt>["runPromise"] = (...args) => rt().runPromise(...(args as [any]))
|
||||
|
||||
Reference in New Issue
Block a user