@chikhamx/voidx 2.2.0 → 2.3.0
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/voidx.js +7 -1
- package/package.json +1 -1
package/bin/voidx.js
CHANGED
|
@@ -22,7 +22,12 @@ function main(argv = process.argv.slice(2), env = process.env) {
|
|
|
22
22
|
const venvDir = resolveVenvDir(env);
|
|
23
23
|
ensureVenv(python, venvDir, env);
|
|
24
24
|
const executable = resolveVoidxExecutable(venvDir);
|
|
25
|
-
const
|
|
25
|
+
const childEnv = {
|
|
26
|
+
...env,
|
|
27
|
+
VOIDX_LAUNCHED_BY_NPM: "1",
|
|
28
|
+
VOIDX_NPM_PACKAGE_VERSION: pkg.version,
|
|
29
|
+
};
|
|
30
|
+
const child = spawn(executable, argv, { stdio: "inherit", env: childEnv });
|
|
26
31
|
child.on("exit", (code, signal) => {
|
|
27
32
|
if (signal) {
|
|
28
33
|
process.kill(process.pid, signal);
|
|
@@ -233,6 +238,7 @@ function ensureVenv(python, venvDir, env) {
|
|
|
233
238
|
}
|
|
234
239
|
|
|
235
240
|
if (!fs.existsSync(executable) || readFile(markerPath) !== marker) {
|
|
241
|
+
const packageSpec = env.VOIDX_NPM_PACKAGE_SPEC || `voidx==${pkg.version}`;
|
|
236
242
|
console.error(
|
|
237
243
|
`\n📦 Downloading ${packageSpec} and dependencies… ` +
|
|
238
244
|
"(1–2 minutes on first run)\n"
|