pi-revit 0.1.2 → 0.1.3
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/pi-revit.js +10 -1
- package/package.json +1 -1
package/bin/pi-revit.js
CHANGED
|
@@ -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}`);
|
|
@@ -75,7 +84,7 @@ if (revitIsRunning()) {
|
|
|
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
|
-
|
|
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
|
|