pi-revit 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -49,7 +49,7 @@ LLM provider, like any Pi session.
49
49
  Close Revit, then in PowerShell:
50
50
 
51
51
  ```powershell
52
- npx -y pi-revit
52
+ npx.cmd -y pi-revit
53
53
  ```
54
54
 
55
55
  This installs the Pi package, builds and deploys the Revit bridge add-in, creates the
package/bin/pi-revit.js CHANGED
@@ -7,7 +7,7 @@ const root = path.resolve(__dirname, "..");
7
7
  const scriptsDir = path.join(root, "scripts");
8
8
 
9
9
  function usage() {
10
- console.log(`pi-revit installer\n\nUsage:\n npx -y pi-revit\n\nWhat it does on Windows:\n 1. Runs: pi install npm:pi-revit\n 2. Builds and deploys the Revit bridge add-in\n 3. Creates the Documents\\pi-revit workspace and global pi-revit command\n\nClose Revit before running. Revit 2025, 2026, or 2027 and the matching .NET SDK are required.`);
10
+ console.log(`pi-revit installer\n\nUsage:\n npx.cmd -y pi-revit\n\nWhat it does on Windows:\n 1. Runs: pi install npm:pi-revit\n 2. Builds and deploys the Revit bridge add-in\n 3. Creates the Documents\\pi-revit workspace and global pi-revit command\n\nClose Revit before running. Revit 2025, 2026, or 2027 and the matching .NET SDK are required.`);
11
11
  }
12
12
 
13
13
  function fail(message) {
@@ -26,6 +26,15 @@ function run(title, command, args) {
26
26
  if (result.status !== 0) process.exit(result.status ?? 1);
27
27
  }
28
28
 
29
+ function runCmd(title, commandLine) {
30
+ console.log(`\n==> ${title}`);
31
+ // On Windows, npm/pi are usually .cmd shims. Run them through cmd.exe so PATHEXT
32
+ // resolution works from npx's Node process just like it does in PowerShell/CMD.
33
+ const result = spawnSync("cmd.exe", ["/d", "/s", "/c", commandLine], { stdio: "inherit" });
34
+ if (result.error) fail(`${commandLine} could not be started: ${result.error.message}`);
35
+ if (result.status !== 0) process.exit(result.status ?? 1);
36
+ }
37
+
29
38
  function runPowerShellScript(scriptName) {
30
39
  const scriptPath = path.join(scriptsDir, scriptName);
31
40
  if (!fs.existsSync(scriptPath)) fail(`missing script: ${scriptPath}`);
@@ -69,13 +78,13 @@ if (!commandExists("dotnet")) {
69
78
 
70
79
  if (revitIsRunning()) {
71
80
  waitForEnter();
72
- if (revitIsRunning()) fail("Revit is still running. Close Revit and run 'npx -y pi-revit' again.");
81
+ if (revitIsRunning()) fail("Revit is still running. Close Revit and run 'npx.cmd -y pi-revit' again.");
73
82
  }
74
83
 
75
84
  console.log("pi-revit full installer");
76
85
  console.log("This installs the Pi package, deploys the Revit add-in, and creates the workspace/global command.");
77
86
 
78
- run("Install the Pi package from npm", "pi", ["install", "npm:pi-revit"]);
87
+ runCmd("Install the Pi package from npm", "pi install npm:pi-revit");
79
88
  runPowerShellScript("deploy.ps1");
80
89
  runPowerShellScript("setup-workspace.ps1");
81
90
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-revit",
3
- "version": "0.1.2",
4
- "description": "Native Pi connector for Autodesk Revit. Run npx -y pi-revit for the full Windows install.",
3
+ "version": "0.1.4",
4
+ "description": "Native Pi connector for Autodesk Revit. Run npx.cmd -y pi-revit for the full Windows install.",
5
5
  "author": "Ahmad Altahlawi",
6
6
  "license": "MIT",
7
7
  "repository": {