mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-11 14:23:25 +00:00
refactor(core): remove unused shell posix metadata (#40734)
This commit is contained in:
parent
0726a25142
commit
3acaa5a359
2 changed files with 6 additions and 16 deletions
|
|
@ -7,16 +7,16 @@ import { Schema } from "effect"
|
|||
import { FSUtil } from "@opencode-ai/util/fs-util"
|
||||
import { which } from "../util/which"
|
||||
|
||||
const META: Record<string, { deny?: boolean; login?: boolean; posix?: boolean; ps?: boolean }> = {
|
||||
bash: { login: true, posix: true },
|
||||
dash: { login: true, posix: true },
|
||||
const META: Record<string, { deny?: boolean; login?: boolean; ps?: boolean }> = {
|
||||
bash: { login: true },
|
||||
dash: { login: true },
|
||||
fish: { deny: true, login: true },
|
||||
ksh: { login: true, posix: true },
|
||||
ksh: { login: true },
|
||||
nu: { deny: true },
|
||||
powershell: { ps: true },
|
||||
pwsh: { ps: true },
|
||||
sh: { login: true, posix: true },
|
||||
zsh: { login: true, posix: true },
|
||||
sh: { login: true },
|
||||
zsh: { login: true },
|
||||
}
|
||||
|
||||
export type Item = {
|
||||
|
|
@ -116,10 +116,6 @@ export function login(file: string) {
|
|||
return meta(file)?.login === true
|
||||
}
|
||||
|
||||
export function posix(file: string) {
|
||||
return meta(file)?.posix === true
|
||||
}
|
||||
|
||||
export function ps(file: string) {
|
||||
return meta(file)?.ps === true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,12 +34,6 @@ describe("shell", () => {
|
|||
expect(ShellSelect.login("C:/tools/pwsh.exe")).toBe(false)
|
||||
})
|
||||
|
||||
test("detects posix shells", () => {
|
||||
expect(ShellSelect.posix("/bin/bash")).toBe(true)
|
||||
expect(ShellSelect.posix("/bin/fish")).toBe(false)
|
||||
expect(ShellSelect.posix("C:/tools/pwsh.exe")).toBe(false)
|
||||
})
|
||||
|
||||
test("falls back when configured shell cannot be resolved", async () => {
|
||||
await withShell(undefined, async () => {
|
||||
const preferred = ShellSelect.preferred()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue