@oh-my-pi/pi-utils 11.0.2 → 11.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/env.ts +4 -4
- package/src/procmgr.ts +4 -4
package/package.json
CHANGED
package/src/env.ts
CHANGED
|
@@ -50,17 +50,17 @@ const projectEnv = parseEnvFile(path.join(process.cwd(), ".env"));
|
|
|
50
50
|
|
|
51
51
|
for (const file of [projectEnv, homeEnv]) {
|
|
52
52
|
for (const [key, value] of Object.entries(file)) {
|
|
53
|
-
if (!
|
|
54
|
-
|
|
53
|
+
if (!Bun.env[key]) {
|
|
54
|
+
Bun.env[key] = value;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Intentional re-export of
|
|
60
|
+
* Intentional re-export of Bun.env.
|
|
61
61
|
*
|
|
62
62
|
* All users should import this env module (import { $env } from "@oh-my-pi/pi-utils")
|
|
63
63
|
* before using environment variables. This ensures that .env files have been loaded and
|
|
64
64
|
* overrides (project, home) have been applied, so $env always reflects the correct values.
|
|
65
65
|
*/
|
|
66
|
-
export const $env: Record<string, string> =
|
|
66
|
+
export const $env: Record<string, string> = Bun.env as Record<string, string>;
|
package/src/procmgr.ts
CHANGED
|
@@ -34,7 +34,7 @@ function isExecutable(path: string): boolean {
|
|
|
34
34
|
function buildSpawnEnv(shell: string): Record<string, string> {
|
|
35
35
|
const noCI = $env.PI_BASH_NO_CI || $env.CLAUDE_BASH_NO_CI;
|
|
36
36
|
return {
|
|
37
|
-
...
|
|
37
|
+
...Bun.env,
|
|
38
38
|
SHELL: shell,
|
|
39
39
|
GIT_EDITOR: "true",
|
|
40
40
|
GPG_TTY: "not a tty",
|
|
@@ -135,11 +135,11 @@ export function getShellConfig(customShellPath?: string): ShellConfig {
|
|
|
135
135
|
if (process.platform === "win32") {
|
|
136
136
|
// 2. Try Git Bash in known locations
|
|
137
137
|
const paths: string[] = [];
|
|
138
|
-
const programFiles =
|
|
138
|
+
const programFiles = Bun.env.ProgramFiles;
|
|
139
139
|
if (programFiles) {
|
|
140
140
|
paths.push(`${programFiles}\\Git\\bin\\bash.exe`);
|
|
141
141
|
}
|
|
142
|
-
const programFilesX86 =
|
|
142
|
+
const programFilesX86 = Bun.env["ProgramFiles(x86)"];
|
|
143
143
|
if (programFilesX86) {
|
|
144
144
|
paths.push(`${programFilesX86}\\Git\\bin\\bash.exe`);
|
|
145
145
|
}
|
|
@@ -168,7 +168,7 @@ export function getShellConfig(customShellPath?: string): ShellConfig {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
// Unix: prefer user's shell from $SHELL if it's bash/zsh and executable
|
|
171
|
-
const userShell =
|
|
171
|
+
const userShell = Bun.env.SHELL;
|
|
172
172
|
const isValidShell = userShell && (userShell.includes("bash") || userShell.includes("zsh"));
|
|
173
173
|
if (isValidShell && isExecutable(userShell)) {
|
|
174
174
|
cachedShellConfig = buildConfig(userShell);
|