Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(setup): resolve slash-do pin via RootDir and guard errors in setup.ps1

Adam Eivy559fd9ce65fe
diff --git a/scripts/slashdo-pin.test.js b/scripts/slashdo-pin.test.js
index 186d307324..41e68ea3eb 100644
--- a/scripts/slashdo-pin.test.js
+++ b/scripts/slashdo-pin.test.js
@@ -18,4 +18,12 @@ describe('slash-do install pin', () => {
expect(src).toMatch(/scripts[\\/]SLASHDO_VERSION/);
expect(src).toMatch(/npx --yes "slash-do@\$\{?SlashdoVersion\}?"|npx --yes "slash-do@\$\{?SLASHDO_VERSION\}?"/i);
});
+
+ it('PowerShell scripts resolve scripts/SLASHDO_VERSION via $RootDir', () => {
+ for (const file of ['setup.ps1', 'update.ps1']) {
+ const src = read(file);
+ expect(src).toMatch(/Join-Path \$RootDir ["']scripts[\\/]SLASHDO_VERSION["']/);
+ expect(src).not.toMatch(/Join-Path \$PSScriptRoot ["']scripts[\\/]SLASHDO_VERSION["']/);
+ }
+ });
});
diff --git a/setup.ps1 b/setup.ps1
index 6dd699b71e..78f3855fb5 100644
--- a/setup.ps1
+++ b/setup.ps1
@@ -97,14 +97,24 @@ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# via npx. Failures are non-fatal — PortOS still works without the
# user-global command pool.
Write-Host ""
-$SlashdoVersion = (Get-Content (Join-Path $PSScriptRoot "scripts/SLASHDO_VERSION") -Raw).Trim()
-Write-Host "Installing/updating slash-do commands (npx slash-do@$SlashdoVersion)..." -ForegroundColor Yellow
-# Pipe "a" so slash-do's "multiple environments detected" prompt auto-selects
-# all detected envs instead of hanging on readline when stdin is not a TTY.
-"a" | & npx --yes "slash-do@$SlashdoVersion"
-if ($LASTEXITCODE -ne 0) {
- Write-Host "⚠️ slash-do install failed — skipping (you can re-run later: npx slash-do@$SlashdoVersion)" -ForegroundColor Yellow
- $global:LASTEXITCODE = 0
+$slashdoFile = Join-Path $RootDir "scripts/SLASHDO_VERSION"
+$SlashdoVersion = if (Test-Path $slashdoFile) { (Get-Content $slashdoFile -Raw).Trim() } else { $null }
+if ($SlashdoVersion) {
+ Write-Host "Installing/updating slash-do commands (npx slash-do@$SlashdoVersion)..." -ForegroundColor Yellow
+ # Pipe "a" so slash-do's "multiple environments detected" prompt auto-selects
+ # all detected envs instead of hanging on readline when stdin is not a TTY.
+ # npx writes status to stderr; scope Continue downgrade around this
+ # stdin-piped call so it isn't aborted by a NativeCommandError (#1811).
+ & {
+ $ErrorActionPreference = 'Continue'
+ "a" | & npx --yes "slash-do@$SlashdoVersion"
+ }
+ if ($LASTEXITCODE -ne 0) {
+ Write-Host "⚠️ slash-do install failed — skipping (you can re-run later: npx slash-do@$SlashdoVersion)" -ForegroundColor Yellow
+ $global:LASTEXITCODE = 0
+ }
+} else {
+ Write-Host "⚠️ scripts/SLASHDO_VERSION not found — skipping slash-do install" -ForegroundColor Yellow
}
# Optional Ghostty setup