x3d-image 2.2.11 → 2.3.1

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/x3d-image.js CHANGED
@@ -4,13 +4,16 @@
4
4
  const os = require ("os");
5
5
  const path = require ("path");
6
6
  const { spawn } = require ("child_process");
7
- const cwd = process .cwd ();
8
- const cmd = os .platform () === "win32" ? "npm.cmd" : "npm";
9
- const args = [... process .argv .slice (2), cwd];
7
+ const dir = process .cwd ();
8
+ const cwd = path .resolve (__dirname, "..");
9
+ const args = process .argv .slice (2);
10
10
 
11
- process .chdir (path .resolve (__dirname, ".."));
11
+ args .unshift ("start", "--silent", "--");
12
+ args .push ("--cwd", dir);
12
13
 
13
- const p = spawn (cmd, ["start", "--silent", "--", btoa (JSON .stringify (args))], { shell: true });
14
+ const p = os .platform () === "win32"
15
+ ? spawn ("cmd.exe", ["/c", "npm.cmd", ... args], { cwd })
16
+ : spawn ("npm", args, { cwd });
14
17
 
15
18
  p .stdout .pipe (process .stdout);
16
19
  p .stderr .pipe (process .stderr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x3d-image",
3
- "version": "2.2.11",
3
+ "version": "2.3.1",
4
4
  "description": "Render image files from X3D",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -52,8 +52,8 @@
52
52
  ],
53
53
  "dependencies": {
54
54
  "colors": "^1.4.0",
55
- "electron": "^37.2.0",
56
- "x_ite": "^12.0.6",
55
+ "electron": "^38.0.0",
56
+ "x_ite": "^12.0.7",
57
57
  "yargs": "^18.0.0"
58
58
  },
59
59
  "devDependencies": {
package/src/main.js CHANGED
@@ -5,10 +5,10 @@ const
5
5
  path = require ("path"),
6
6
  colors = require ("colors");
7
7
 
8
- // Restore argv.
8
+ // Restore cwd.
9
9
 
10
- process .argv = process .argv .concat (JSON .parse (atob (process .argv .pop ())));
11
- process .chdir (process .argv .pop ());
10
+ if (process .argv .at (-2) === "--cwd")
11
+ process .chdir (process .argv .at (-1));
12
12
 
13
13
  // Set env vars for Electron.
14
14