@inventeer.tech/apex 0.2.36 → 0.2.37

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.
Files changed (2) hide show
  1. package/install.js +16 -7
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -1,4 +1,4 @@
1
- const { execSync } = require("child_process");
1
+ const { execSync, execFileSync } = require("child_process");
2
2
  const fs = require("fs");
3
3
  const path = require("path");
4
4
  const os = require("os");
@@ -51,12 +51,21 @@ async function main() {
51
51
  } else {
52
52
  const extractDir = path.join(os.tmpdir(), "apex-extract-" + Date.now());
53
53
  fs.mkdirSync(extractDir, { recursive: true });
54
- execSync(
55
- 'powershell -Command "Expand-Archive -Force \'' +
56
- tmp +
57
- "' '" +
58
- extractDir +
59
- "'\"",
54
+ const safeTmp = tmp.replace(/'/g, "''");
55
+ const safeExtractDir = extractDir.replace(/'/g, "''");
56
+ const psCmd =
57
+ "$ErrorActionPreference='Stop'; " +
58
+ "$ProgressPreference='SilentlyContinue'; " +
59
+ "Import-Module Microsoft.PowerShell.Archive -Force; " +
60
+ "Expand-Archive -LiteralPath '" +
61
+ safeTmp +
62
+ "' -DestinationPath '" +
63
+ safeExtractDir +
64
+ "' -Force";
65
+ execFileSync(
66
+ "powershell.exe",
67
+ ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", psCmd],
68
+ { stdio: "inherit" },
60
69
  );
61
70
  fs.copyFileSync(
62
71
  path.join(extractDir, binaryName),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inventeer.tech/apex",
3
- "version": "0.2.36",
3
+ "version": "0.2.37",
4
4
  "description": "AI-powered software delivery agent",
5
5
  "bin": {
6
6
  "apex": "./bin/apex"