@askexenow/exe-os 0.8.95 → 0.8.96
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/bin/install.js +12 -2
- package/package.json +1 -1
package/dist/bin/install.js
CHANGED
|
@@ -973,7 +973,7 @@ function summarizeSymlinkResults(results) {
|
|
|
973
973
|
import { existsSync as existsSync6, readFileSync as readFileSync5, unlinkSync as unlinkSync3, readdirSync as readdirSync2, openSync, closeSync } from "fs";
|
|
974
974
|
import { spawn, execSync as execSync3 } from "child_process";
|
|
975
975
|
import path6 from "path";
|
|
976
|
-
import
|
|
976
|
+
import os5 from "os";
|
|
977
977
|
|
|
978
978
|
// src/lib/session-wrappers.ts
|
|
979
979
|
import {
|
|
@@ -1103,6 +1103,7 @@ export PATH="${binDir}:$PATH"
|
|
|
1103
1103
|
}
|
|
1104
1104
|
|
|
1105
1105
|
// src/bin/install.ts
|
|
1106
|
+
var homedir2 = os5.homedir;
|
|
1106
1107
|
var EXE_DIR = path6.join(homedir2(), ".exe-os");
|
|
1107
1108
|
function restartDaemon() {
|
|
1108
1109
|
const pidPath = path6.join(EXE_DIR, "exed.pid");
|
|
@@ -1171,6 +1172,14 @@ function restartDaemon() {
|
|
|
1171
1172
|
}
|
|
1172
1173
|
} catch {
|
|
1173
1174
|
}
|
|
1175
|
+
const totalGB = os5.totalmem() / (1024 * 1024 * 1024);
|
|
1176
|
+
if (totalGB <= 8) {
|
|
1177
|
+
process.stderr.write(
|
|
1178
|
+
`exe-os: ${totalGB.toFixed(0)}GB system \u2014 skipping daemon spawn (keyword search mode)
|
|
1179
|
+
`
|
|
1180
|
+
);
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1174
1183
|
try {
|
|
1175
1184
|
const pkgRoot = resolvePackageRoot();
|
|
1176
1185
|
const daemonPath = path6.join(pkgRoot, "dist", "lib", "exe-daemon.js");
|
|
@@ -1185,7 +1194,8 @@ function restartDaemon() {
|
|
|
1185
1194
|
stderrFd = openSync(logPath, "a");
|
|
1186
1195
|
} catch {
|
|
1187
1196
|
}
|
|
1188
|
-
const
|
|
1197
|
+
const heapCapMB = totalGB <= 16 ? 256 : 512;
|
|
1198
|
+
const child = spawn(process.execPath, [`--max-old-space-size=${heapCapMB}`, daemonPath], {
|
|
1189
1199
|
detached: true,
|
|
1190
1200
|
stdio: ["ignore", "ignore", stderrFd],
|
|
1191
1201
|
env: {
|
package/package.json
CHANGED