Skip to content

Commit 924fa79

Browse files
committed
style: improve git command env prefix readability with line continuation
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent c78241e commit 924fa79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/hooks/non-interactive-env/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ function shellEscape(value: string): string {
3434
}
3535

3636
/**
37-
* Build env prefix string: VAR1=val1 VAR2=val2 ...
37+
* Build env prefix string with line continuation for readability:
38+
* VAR1=val1 \
39+
* VAR2=val2 \
40+
* ...
3841
* OpenCode's bash tool ignores args.env, so we must prepend to command.
3942
*/
4043
function buildEnvPrefix(env: Record<string, string>): string {
4144
return Object.entries(env)
4245
.map(([key, value]) => `${key}=${shellEscape(value)}`)
43-
.join(" ")
46+
.join(" \\\n")
4447
}
4548

4649
export function createNonInteractiveEnvHook(_ctx: PluginInput) {

0 commit comments

Comments
 (0)