@nightkatana/kronosys-app 1.0.0-beta.10 → 1.0.0-beta.12
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/bin/kronosys.mjs +27 -7
- package/package.json +1 -1
package/bin/kronosys.mjs
CHANGED
|
@@ -25,6 +25,7 @@ const inNodeModules =
|
|
|
25
25
|
const isWindows = process.platform === "win32";
|
|
26
26
|
const npmBin = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
27
27
|
const npxBin = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
28
|
+
const psBin = process.platform === "win32" ? "powershell.exe" : null;
|
|
28
29
|
|
|
29
30
|
const [, , command = "start", ...rest] = process.argv;
|
|
30
31
|
|
|
@@ -51,16 +52,18 @@ if (!commands[command]) {
|
|
|
51
52
|
|
|
52
53
|
function runCommand(bin, args, env, cwd) {
|
|
53
54
|
return new Promise((resolvePromise, rejectPromise) => {
|
|
55
|
+
const windowsArg = (arg) => `'${String(arg).replaceAll("'", "''")}'`;
|
|
56
|
+
|
|
54
57
|
const child = isWindows
|
|
55
58
|
? spawn(
|
|
56
|
-
|
|
59
|
+
psBin,
|
|
57
60
|
[
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
"-NoLogo",
|
|
62
|
+
"-NoProfile",
|
|
63
|
+
"-ExecutionPolicy",
|
|
64
|
+
"Bypass",
|
|
65
|
+
"-Command",
|
|
66
|
+
"& " + [bin, ...args].map(windowsArg).join(" "),
|
|
64
67
|
],
|
|
65
68
|
{
|
|
66
69
|
cwd,
|
|
@@ -132,6 +135,7 @@ async function main() {
|
|
|
132
135
|
["install", "--omit=dev", "--ignore-scripts", "--no-audit", "--no-fund"],
|
|
133
136
|
{
|
|
134
137
|
...env,
|
|
138
|
+
HUSKY: "0",
|
|
135
139
|
npm_config_cache:
|
|
136
140
|
process.env.npm_config_cache ?? resolve(homedir(), ".npm"),
|
|
137
141
|
},
|
|
@@ -140,6 +144,22 @@ async function main() {
|
|
|
140
144
|
if (installCode !== 0) {
|
|
141
145
|
process.exit(installCode);
|
|
142
146
|
}
|
|
147
|
+
|
|
148
|
+
// Ensure native bindings are present for the current OS/ABI.
|
|
149
|
+
const rebuildCode = await runCommand(
|
|
150
|
+
npmBin,
|
|
151
|
+
["rebuild", "better-sqlite3", "--no-audit", "--no-fund"],
|
|
152
|
+
{
|
|
153
|
+
...env,
|
|
154
|
+
HUSKY: "0",
|
|
155
|
+
npm_config_cache:
|
|
156
|
+
process.env.npm_config_cache ?? resolve(homedir(), ".npm"),
|
|
157
|
+
},
|
|
158
|
+
runRoot,
|
|
159
|
+
);
|
|
160
|
+
if (rebuildCode !== 0) {
|
|
161
|
+
process.exit(rebuildCode);
|
|
162
|
+
}
|
|
143
163
|
}
|
|
144
164
|
|
|
145
165
|
// Production mode requires a Next build. Build once on first run.
|