@pushpalsdev/cli 1.0.31 → 1.0.32
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/dist/pushpals-cli.js +29 -0
- package/package.json +1 -1
package/dist/pushpals-cli.js
CHANGED
|
@@ -2055,6 +2055,7 @@ function buildEmbeddedRuntimeEnv(baseEnv, opts) {
|
|
|
2055
2055
|
const env = normalizeChildProcessEnv(baseEnv);
|
|
2056
2056
|
const useRuntimeConfig = opts.useRuntimeConfig !== false;
|
|
2057
2057
|
const platform = opts.platform ?? process.platform;
|
|
2058
|
+
const embeddedBunBin = resolveEmbeddedBunExecutableFromEnv(env, platform);
|
|
2058
2059
|
const inherited = { ...env };
|
|
2059
2060
|
if (!useRuntimeConfig) {
|
|
2060
2061
|
delete inherited.PUSHPALS_CONFIG_DIR_OVERRIDE;
|
|
@@ -2081,6 +2082,7 @@ function buildEmbeddedRuntimeEnv(baseEnv, opts) {
|
|
|
2081
2082
|
},
|
|
2082
2083
|
PUSHPALS_PROTOCOL_SCHEMAS_DIR: join2(opts.runtimeRoot, "protocol", "schemas"),
|
|
2083
2084
|
...typeof opts.sessionId === "string" && opts.sessionId.trim() ? { PUSHPALS_SESSION_ID: opts.sessionId.trim() } : {},
|
|
2085
|
+
...embeddedBunBin ? { PUSHPALS_BUN_BIN: embeddedBunBin } : {},
|
|
2084
2086
|
...embeddedWindowsSafetyCaps,
|
|
2085
2087
|
...typeof env.PUSHPALS_GIT_BIN === "string" && env.PUSHPALS_GIT_BIN.trim() ? { PUSHPALS_GIT_BIN: env.PUSHPALS_GIT_BIN.trim() } : {},
|
|
2086
2088
|
...typeof env.PUSHPALS_GIT_BIN_ABSOLUTE === "string" && env.PUSHPALS_GIT_BIN_ABSOLUTE.trim() ? { PUSHPALS_GIT_BIN_ABSOLUTE: env.PUSHPALS_GIT_BIN_ABSOLUTE.trim() } : {},
|
|
@@ -2098,6 +2100,32 @@ function parseBooleanFlag(raw) {
|
|
|
2098
2100
|
return false;
|
|
2099
2101
|
return null;
|
|
2100
2102
|
}
|
|
2103
|
+
function resolveEmbeddedBunExecutableFromEnv(env, platform = process.platform, currentExecPathOverride) {
|
|
2104
|
+
const explicit = String(env.PUSHPALS_BUN_BIN ?? "").trim();
|
|
2105
|
+
if (explicit)
|
|
2106
|
+
return explicit;
|
|
2107
|
+
const currentExecPath = String(currentExecPathOverride ?? process.execPath ?? "").trim();
|
|
2108
|
+
const currentExecLeaf = basename(currentExecPath).toLowerCase();
|
|
2109
|
+
if (currentExecLeaf === "bun" || currentExecLeaf === "bun.exe") {
|
|
2110
|
+
return currentExecPath;
|
|
2111
|
+
}
|
|
2112
|
+
const pathValue = platform === "win32" ? String(env.PATH ?? env.Path ?? "").trim() : String(env.PATH ?? "").trim();
|
|
2113
|
+
if (!pathValue)
|
|
2114
|
+
return "";
|
|
2115
|
+
const candidates = platform === "win32" ? ["bun.exe", "bun", "bun.cmd", "bun.bat"] : ["bun"];
|
|
2116
|
+
for (const rawDir of pathValue.split(delimiter)) {
|
|
2117
|
+
const dir = rawDir.trim();
|
|
2118
|
+
if (!dir)
|
|
2119
|
+
continue;
|
|
2120
|
+
for (const candidate of candidates) {
|
|
2121
|
+
const fullPath = join2(dir, candidate);
|
|
2122
|
+
if (existsSync4(fullPath)) {
|
|
2123
|
+
return fullPath;
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
return "";
|
|
2128
|
+
}
|
|
2101
2129
|
function normalizeChildProcessEnv(baseEnv, platform = process.platform) {
|
|
2102
2130
|
const env = {};
|
|
2103
2131
|
for (const [key, value] of Object.entries(baseEnv)) {
|
|
@@ -4784,6 +4812,7 @@ export {
|
|
|
4784
4812
|
resolveRuntimeGitExecutableCandidates,
|
|
4785
4813
|
resolveRuntimeDockerExecutableCandidates,
|
|
4786
4814
|
resolvePreferredRuntimeReleaseTag,
|
|
4815
|
+
resolveEmbeddedBunExecutableFromEnv,
|
|
4787
4816
|
resolveCommandPath,
|
|
4788
4817
|
resolveCliStatePath,
|
|
4789
4818
|
resolveCliLocalBuddyAutostart,
|