@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-utils",
3
- "version": "11.0.2",
3
+ "version": "11.0.3",
4
4
  "description": "Shared utilities for pi packages",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
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 (!process.env[key]) {
54
- process.env[key] = value;
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 process.env.
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> = process.env as 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
- ...process.env,
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 = process.env.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 = process.env["ProgramFiles(x86)"];
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 = process.env.SHELL;
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);