fix(core): preserve shell selection compatibility

This commit is contained in:
rekram1-node
2026-08-23 18:03:21 +00:00
committed by Hona
parent 9018aa700a
commit 75b76f34bd
+12
View File
@@ -186,6 +186,18 @@ resolve.reset = () => {
defaultCompatible = undefined
}
/** @deprecated Use `resolve({ preference: "configured" })` instead. */
export function preferred(configShell?: string, options?: Options, bin?: string) {
return resolve({ preference: "configured" }, configShell, options, bin)
}
preferred.reset = resolve.reset
/** @deprecated Use `resolve({ preference: "compatible" })` instead. */
export function acceptable(configShell?: string, options?: Options, bin?: string) {
return resolve({ preference: "compatible" }, configShell, options, bin)
}
acceptable.reset = resolve.reset
export async function list(options?: Options, bin?: string): Promise<Item[]> {
const shells = process.platform === "win32" ? win(options, bin) : await unix()
return shells.filter((shell) => executable(shell, options, bin)).map((shell) => info(shell, options, bin))