mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 09:44:21 +01:00
fix: Provide OPENCODE & AGENT env vars (#3843)
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
committed by
opencode
parent
af9a1797b5
commit
b275e18d28
@@ -82,7 +82,13 @@ export const TuiThreadCommand = cmd({
|
|||||||
return undefined
|
return undefined
|
||||||
})()
|
})()
|
||||||
|
|
||||||
const worker = new Worker("./src/cli/cmd/tui/worker.ts")
|
const worker = new Worker("./src/cli/cmd/tui/worker.ts", {
|
||||||
|
env: Object.fromEntries(
|
||||||
|
Object.entries(process.env).filter(
|
||||||
|
(entry): entry is [string, string] => entry[1] !== undefined,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
})
|
||||||
worker.onerror = console.error
|
worker.onerror = console.error
|
||||||
const client = Rpc.client<typeof rpc>(worker)
|
const client = Rpc.client<typeof rpc>(worker)
|
||||||
process.on("uncaughtException", (e) => {
|
process.on("uncaughtException", (e) => {
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ const cli = yargs(hideBin(process.argv))
|
|||||||
})(),
|
})(),
|
||||||
})
|
})
|
||||||
|
|
||||||
process.env["OPENCODE"] = "1"
|
process.env.AGENT = "1"
|
||||||
|
process.env.OPENCODE = "1"
|
||||||
|
|
||||||
Log.Default.info("opencode", {
|
Log.Default.info("opencode", {
|
||||||
version: Installation.VERSION,
|
version: Installation.VERSION,
|
||||||
|
|||||||
@@ -144,6 +144,9 @@ export const BashTool = Tool.define("bash", {
|
|||||||
const proc = spawn(params.command, {
|
const proc = spawn(params.command, {
|
||||||
shell: true,
|
shell: true,
|
||||||
cwd: Instance.directory,
|
cwd: Instance.directory,
|
||||||
|
env: {
|
||||||
|
...process.env,
|
||||||
|
},
|
||||||
stdio: ["ignore", "pipe", "pipe"],
|
stdio: ["ignore", "pipe", "pipe"],
|
||||||
detached: process.platform !== "win32",
|
detached: process.platform !== "win32",
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user