Skip to content

Commit 503e992

Browse files
committed
fix ci test windows
1 parent 98cf1e8 commit 503e992

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

packages/opencode/src/pty/service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from "path"
21
import { BusEvent } from "@/bus/bus-event"
32
import { Bus } from "@/bus"
43
import { InstanceState } from "@/effect"
@@ -57,11 +56,10 @@ const pty = lazy(() => import("#pty"))
5756

5857
function argv(command: string, args: string[], clean: boolean) {
5958
if (args.length > 0) return args
60-
const name = (
61-
process.platform === "win32" ? path.win32.basename(command, ".exe") : path.basename(command)
62-
).toLowerCase()
59+
const name = Shell.name(command)
6360
if (name === "zsh") return clean ? ["-f"] : ["-l"]
6461
if (name === "bash") return clean ? ["--noprofile", "--norc"] : ["-l"]
62+
if (name === "pwsh" || name === "powershell") return args
6563
if (name.endsWith("sh")) return clean ? [] : ["-l"]
6664
return args
6765
}

packages/opencode/test/cli/tui/plugin-loader.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export default {
331331
const localOpts = {
332332
fn_marker: tmp.extra.fnMarker,
333333
marker: tmp.extra.localMarker,
334-
source: tmp.extra.localDest.replace(".opencode/themes/", ""),
334+
source: tmp.extra.localDest.replace(path.join(".opencode", "themes") + path.sep, ""),
335335
dest: tmp.extra.localDest,
336336
theme_path: `./${tmp.extra.localThemeFile}`,
337337
theme_name: tmp.extra.localThemeName,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ afterEach(() => {
7272

7373
describe("tool.bash sandbox", () => {
7474
test("allows in-project writes and skips zsh startup files in sandbox mode", async () => {
75+
if (process.platform !== "darwin") return
7576
await using home = await tmpdir({
7677
init: async (dir) => {
7778
await Bun.write(path.join(dir, ".zshenv"), "export OPENCODE_ZSHENV_HIT=1\n")

0 commit comments

Comments
 (0)