Skip to content

Commit 8bf5cd9

Browse files
elrrrrrrrclaude
andcommitted
fix(e2e): look for binary in package dir, not npm shim path
On Windows, npm install -g creates shim files at <prefix>/utoo.exe that are text wrappers. Look for the actual binary inside node_modules/utoo/bin/ instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 151061b commit 8bf5cd9

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

e2e/utoo-pm.ps1

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,18 +254,27 @@ try {
254254
npm install -g $tarball.FullName "--prefix=$installPrefix" 2>&1
255255
Write-Host "Installed to: $installPrefix"
256256

257-
# Verify the binary works
258-
$installedUtoo = Join-Path $installPrefix "node_modules\utoo\bin\utoo.exe"
259-
if (-not (Test-Path $installedUtoo)) {
260-
$installedUtoo = Join-Path $installPrefix "utoo.exe"
257+
# Verify the binary exists in the package dir (not the npm shim)
258+
$candidatePaths = @(
259+
(Join-Path $installPrefix "node_modules\utoo\bin\utoo.exe"),
260+
(Join-Path $installPrefix "node_modules\utoo\bin\utoo")
261+
)
262+
$installedUtoo = $null
263+
foreach ($p in $candidatePaths) {
264+
if (Test-Path $p) { $installedUtoo = $p; break }
261265
}
262-
if (-not (Test-Path $installedUtoo)) {
266+
if (-not $installedUtoo) {
267+
Write-Host "Contents of install prefix:"
268+
Get-ChildItem -Recurse $installPrefix | Select-Object FullName | Format-Table
263269
throw "utoo binary not found after npm install -g"
264270
}
265271

266-
# Verify it's not a placeholder
267-
$content = Get-Content $installedUtoo -Raw -ErrorAction SilentlyContinue
268-
if ($content -and $content.Contains("placeholder")) {
272+
Write-Host "Found binary at: $installedUtoo"
273+
274+
# Verify it's not a placeholder (read first bytes, not text)
275+
$bytes = [System.IO.File]::ReadAllBytes($installedUtoo)
276+
$header = [System.Text.Encoding]::ASCII.GetString($bytes, 0, [Math]::Min(100, $bytes.Length))
277+
if ($header.Contains("placeholder")) {
269278
throw "installed binary is still a placeholder"
270279
}
271280

0 commit comments

Comments
 (0)