pi-revit 0.1.6 → 0.1.7
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 +9 -10
- package/package.json +1 -1
- package/scripts/uninstall.ps1 +22 -8
package/README.md
CHANGED
|
@@ -70,10 +70,10 @@ pi install npm:pi-revit
|
|
|
70
70
|
cd "$env:USERPROFILE\.pi\agent\npm\node_modules\pi-revit"
|
|
71
71
|
|
|
72
72
|
# 3. Build + deploy the Revit add-in (RevitBridge.dll + the Roslyn DLLs for execute_csharp).
|
|
73
|
-
npm run deploy
|
|
73
|
+
npm.cmd run deploy
|
|
74
74
|
|
|
75
75
|
# 4. Create the workspace and global pi-revit command.
|
|
76
|
-
npm run setup
|
|
76
|
+
npm.cmd run setup
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
For a non-default Revit install location, use the PowerShell deploy script directly and pass
|
|
@@ -111,7 +111,7 @@ That's all. Pi starts with the Revit tools ready:
|
|
|
111
111
|
> select all structural columns
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
**How this works:**
|
|
114
|
+
**How this works:** the setup step placed a small `pi-revit` command in the same folder as the
|
|
115
115
|
`pi` command itself. That folder is on your system PATH — which is exactly why *every* terminal
|
|
116
116
|
finds `pi-revit`, with no extra configuration. When you run it, it switches to your workspace at
|
|
117
117
|
`Documents\pi-revit` and starts Pi there, so your conventions file (`AGENTS.md`) loads
|
|
@@ -165,12 +165,11 @@ Plain `pi` from any folder also works; `pi-revit` just adds the right working fo
|
|
|
165
165
|
|
|
166
166
|
### npm install
|
|
167
167
|
|
|
168
|
-
Close Revit, then in PowerShell
|
|
168
|
+
Close Revit, then in PowerShell — from any folder **outside** the installed package (Windows
|
|
169
|
+
cannot delete a folder your shell is standing in):
|
|
169
170
|
|
|
170
171
|
```powershell
|
|
171
|
-
|
|
172
|
-
powershell -ExecutionPolicy Bypass -File scripts\uninstall.ps1
|
|
173
|
-
pi remove npm:pi-revit
|
|
172
|
+
powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.pi\agent\npm\node_modules\pi-revit\scripts\uninstall.ps1"
|
|
174
173
|
```
|
|
175
174
|
|
|
176
175
|
### Source install
|
|
@@ -182,9 +181,9 @@ powershell -ExecutionPolicy Bypass -File scripts\uninstall.ps1
|
|
|
182
181
|
```
|
|
183
182
|
|
|
184
183
|
This removes the Revit bridge add-in (every installed Revit version), the global `pi-revit`
|
|
185
|
-
command,
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
command, the bridge runtime folder (`%APPDATA%\RevitBridge\`), and the Pi package registration
|
|
185
|
+
(it tries both the npm and the source-install form, so no extra `pi remove` is needed for
|
|
186
|
+
either install kind). Your workspace at `Documents\pi-revit` (notes + session
|
|
188
187
|
history) is **preserved** — add `-RemoveWorkspace` to delete it too, or `-RevitVersion 2026` to
|
|
189
188
|
target a single Revit version. Pi itself is left installed; remove it with
|
|
190
189
|
`npm uninstall -g @earendil-works/pi-coding-agent` if you want.
|
package/package.json
CHANGED
package/scripts/uninstall.ps1
CHANGED
|
@@ -96,14 +96,30 @@ Remove-IfExists (Join-Path $env:APPDATA 'RevitBridge') 'bridge runtime folder'
|
|
|
96
96
|
# is actually registered, so a machine with both gets both removed.
|
|
97
97
|
if ($pi) {
|
|
98
98
|
$repoRoot = Split-Path $PSScriptRoot -Parent
|
|
99
|
-
|
|
99
|
+
# When this script runs from the npm-installed copy, `pi remove npm:pi-revit`
|
|
100
|
+
# deletes the very folder the script lives in — and Windows fails that delete
|
|
101
|
+
# (EBUSY) while any working directory sits inside it. Step our own process out
|
|
102
|
+
# if needed; the calling shell's location we can only warn about.
|
|
103
|
+
if ($repoRoot -match '\\node_modules\\' -and
|
|
104
|
+
(Get-Location).Path.StartsWith($repoRoot, [StringComparison]::OrdinalIgnoreCase)) {
|
|
105
|
+
Set-Location $env:SystemRoot
|
|
106
|
+
Write-Warning "This PowerShell was started inside $repoRoot. If the package removal below fails, run 'cd \' in your shell and re-run the uninstall."
|
|
107
|
+
}
|
|
100
108
|
try {
|
|
101
109
|
$removed = @()
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
# './' resolves against the repo root, so it runs from there — and first,
|
|
111
|
+
# while this folder is guaranteed to still exist. 'npm:pi-revit' then runs
|
|
112
|
+
# from a neutral directory so no working directory blocks the folder delete.
|
|
113
|
+
foreach ($source in @('./', 'npm:pi-revit')) {
|
|
114
|
+
Push-Location $(if ($source -eq './') { $repoRoot } else { $env:SystemRoot })
|
|
115
|
+
try {
|
|
116
|
+
$global:LASTEXITCODE = 0
|
|
117
|
+
& pi remove $source
|
|
118
|
+
if ($LASTEXITCODE -eq 0) {
|
|
119
|
+
$removed += $source
|
|
120
|
+
}
|
|
121
|
+
} finally {
|
|
122
|
+
Pop-Location
|
|
107
123
|
}
|
|
108
124
|
}
|
|
109
125
|
if ($removed.Count -gt 0) {
|
|
@@ -113,8 +129,6 @@ if ($pi) {
|
|
|
113
129
|
}
|
|
114
130
|
} catch {
|
|
115
131
|
Write-Warning "Could not auto-remove the Pi package; run 'pi remove npm:pi-revit' (npm install) or 'pi remove ./' from this repo (install from source). ($_)"
|
|
116
|
-
} finally {
|
|
117
|
-
Pop-Location
|
|
118
132
|
}
|
|
119
133
|
}
|
|
120
134
|
|