feat: install.ps1 -Reload, switch layout at the end, document the junction reload
Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
1 parent
65b66f86cd
commit
cb7f7b58f5
2 files changed
+37
-4
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
Source of the `ovis-composer` Herdr mod (Unified Prompt Experience).
|
||||
|
||||
- `mod/ovis-composer/` - the mod (ES modules, hot-reloaded by Herdr)
|
||||
- `mod/ovis-composer/` - the mod (ES modules; Herdr does not see changes behind the junction - see Reload)
|
||||
- `layouts/ovis-composer.json` - its layout
|
||||
- `tests/` - Node tests for the pure modules (`npm test`)
|
||||
- `docs/superpowers/` - spec and plan
|
||||
@@ -18,8 +18,20 @@ Idempotent. An existing real `mods\ovis-composer` directory is renamed to
|
||||
takes its place, and the layout is copied to `~\.config\herdr-app\layouts\`
|
||||
(existing file backed up once as `.bak-20261119`).
|
||||
|
||||
Then switch: `herdr-app do layout.switch '{"name":"ovis-composer"}'` and check
|
||||
with `herdr-app check <mods>\ovis-composer` and `herdr-app status`.
|
||||
The script ends with `herdr-app do layout.switch '{"name":"ovis-composer"}'`.
|
||||
Check with `herdr-app check <mods>\ovis-composer` and `herdr-app status`.
|
||||
|
||||
## Reload
|
||||
|
||||
Herdr does **not** see changes to the mod files behind the junction: a running
|
||||
copy keeps the code it loaded. After every edit of `mod\ovis-composer`:
|
||||
|
||||
```powershell
|
||||
.\scripts\install.ps1 -Reload
|
||||
```
|
||||
|
||||
It removes the junction and makes it again (the repo files stay), and Herdr
|
||||
loads the mod from scratch.
|
||||
|
||||
## Uninstall
|
||||
|
||||
|
||||
+22
-1
@@ -2,11 +2,16 @@
|
||||
#
|
||||
# .\scripts\install.ps1 install (idempotent)
|
||||
# .\scripts\install.ps1 -Uninstall remove the junction, restore backups
|
||||
# .\scripts\install.ps1 -Reload recreate the junction so Herdr loads the mod again
|
||||
#
|
||||
# Herdr does NOT see changes behind the junction on its own: after editing
|
||||
# mod\ovis-composer run -Reload (the junction is removed and made again, and
|
||||
# Herdr reloads the mod).
|
||||
#
|
||||
# Works on Windows PowerShell 5.
|
||||
|
||||
[CmdletBinding()]
|
||||
param([switch]$Uninstall)
|
||||
param([switch]$Uninstall, [switch]$Reload)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
@@ -65,6 +70,18 @@ function Install-KeyEntry {
|
||||
Write-Host "keys.json: $chord -> $action"
|
||||
}
|
||||
|
||||
if ($Reload) {
|
||||
if (-not (Test-Junction $Junction)) { throw "$Junction is not a junction - run install.ps1 first." }
|
||||
Remove-Junction $Junction
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $ModSource 'main.js'))) {
|
||||
throw 'Repo files vanished after removing the junction - aborting.'
|
||||
}
|
||||
cmd /c mklink /J "`"$Junction`"" "`"$ModSource`"" | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) { throw 'mklink /J failed' }
|
||||
Write-Host "Junction recreated: $Junction -> $ModSource (Herdr loads the mod again)"
|
||||
exit 0
|
||||
}
|
||||
|
||||
if ($Uninstall) {
|
||||
if (Test-Junction $Junction) {
|
||||
Remove-Junction $Junction
|
||||
@@ -131,3 +148,7 @@ Write-Host "Layout copied"
|
||||
|
||||
# 3. Key binding (Task 2).
|
||||
Install-KeyEntry
|
||||
|
||||
# 4. Show the layout.
|
||||
herdr-app do layout.switch '{"name":"ovis-composer"}'
|
||||
if ($LASTEXITCODE -ne 0) { Write-Warning "layout.switch to ovis-composer failed (exit $LASTEXITCODE) - switch the layout by hand." }
|
||||
Reference in new issue
Block a user