Hardcoded platform check forced PowerShell env syntax on Windows regardless of the actual shell. Replaced with detectShellType() so Git Bash, WSL, and similar environments use unix prefixes while native PowerShell continues to get powershell prefixes. 🤖 Generated with OhMyOpenCode assistance https://github.com/code-yeongyu/oh-my-opencode
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin"
|
||||
import { HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS } from "./constants"
|
||||
import { log, buildEnvPrefix } from "../../shared"
|
||||
import { detectShellType } from "../../shared/shell-env"
|
||||
|
||||
export * from "./constants"
|
||||
export * from "./detector"
|
||||
@@ -52,7 +53,7 @@ export function createNonInteractiveEnvHook(_ctx: PluginInput) {
|
||||
// The env vars (GIT_EDITOR=:, EDITOR=:, etc.) must ALWAYS be injected
|
||||
// for git commands to prevent interactive prompts.
|
||||
|
||||
const shellType = process.platform === "win32" ? "powershell" : "unix"
|
||||
const shellType = detectShellType()
|
||||
const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV, shellType)
|
||||
|
||||
// Check if the command already starts with the prefix to avoid stacking.
|
||||
|
||||
Reference in New Issue
Block a user