Skip to content

Commit 9b57ee6

Browse files
committed
test(bash): use -p instead of -e for PowerShell env tests
1 parent 0324505 commit 9b57ee6

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/opencode/test/tool/bash.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,10 +1117,12 @@ describe("tool.bash env", () => {
11171117
directory: projectRoot,
11181118
fn: async () => {
11191119
const bash = await initBash()
1120-
const code = `console.log(process.env.TEST_VAR)`
1120+
const expr = `process.env.TEST_VAR`
1121+
const cmd = `${bin} -p ${evalarg(expr)}`
1122+
const command = PS.has(sh()) ? `& ${cmd}` : cmd
11211123
const result = await bash.execute(
11221124
{
1123-
command: `${bin} -e ${evalarg(code)}`,
1125+
command,
11241126
description: "Echo environment variable",
11251127
env: { TEST_VAR: "hello_world" },
11261128
},
@@ -1137,10 +1139,12 @@ describe("tool.bash env", () => {
11371139
directory: projectRoot,
11381140
fn: async () => {
11391141
const bash = await initBash()
1140-
const code = `console.log(process.env.VAR1, process.env.VAR2)`
1142+
const expr = `process.env.VAR1 + " " + process.env.VAR2`
1143+
const cmd = `${bin} -p ${evalarg(expr)}`
1144+
const command = PS.has(sh()) ? `& ${cmd}` : cmd
11411145
const result = await bash.execute(
11421146
{
1143-
command: `${bin} -e ${evalarg(code)}`,
1147+
command,
11441148
description: "Echo multiple environment variables",
11451149
env: { VAR1: "foo", VAR2: "bar" },
11461150
},

0 commit comments

Comments
 (0)