Skip to content

Commit bbf7a23

Browse files
anandgupta42claude
andcommitted
fix: address CodeRabbit review — explicit find pattern, Windows path.delimiter, binary names
- Use `*altimate-code-linux-x64/bin/altimate` in pre-publish find pattern for clarity (old pattern worked but was ambiguous) - Use `path.delimiter` instead of hardcoded `:` for NODE_PATH in both `pre-release-check.ts` and `smoke-test-binary.test.ts` - Handle Windows `altimate.exe` binary name in `searchDist()` functions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b3baea0 commit bbf7a23

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ jobs:
192192
# compile-time checks miss (e.g. missing NAPI externals like v0.5.10).
193193
- name: Pre-publish smoke test
194194
run: |
195-
BINARY=$(find packages/opencode/dist -path '*/linux-x64/*/altimate' -type f | head -1)
195+
BINARY=$(find packages/opencode/dist -path '*altimate-code-linux-x64/bin/altimate' -type f | head -1)
196196
if [ -z "$BINARY" ]; then
197197
echo "::error::No linux-x64 binary found in artifacts — cannot verify release"
198198
exit 1

packages/opencode/script/pre-release-check.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,16 @@ if (buildResult.status !== 0) {
8585
// Find the binary — walk recursively for scoped packages (@altimateai/...)
8686
const distDir = path.join(pkgDir, "dist")
8787
let binaryPath: string | undefined
88+
const binaryNames = process.platform === "win32" ? ["altimate.exe", "altimate"] : ["altimate"]
8889
function searchDist(dir: string): string | undefined {
8990
if (!fs.existsSync(dir)) return undefined
9091
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
9192
if (!entry.isDirectory()) continue
9293
const sub = path.join(dir, entry.name)
93-
const candidate = path.join(sub, "bin", "altimate")
94-
if (fs.existsSync(candidate)) return candidate
94+
for (const name of binaryNames) {
95+
const candidate = path.join(sub, "bin", name)
96+
if (fs.existsSync(candidate)) return candidate
97+
}
9598
const nested = searchDist(sub)
9699
if (nested) return nested
97100
}
@@ -121,7 +124,7 @@ if (buildResult.status !== 0) {
121124
timeout: 15_000,
122125
env: {
123126
...process.env,
124-
NODE_PATH: nodePaths.join(":"),
127+
NODE_PATH: nodePaths.join(path.delimiter),
125128
OPENCODE_DISABLE_TELEMETRY: "1",
126129
},
127130
})

packages/opencode/test/install/smoke-test-binary.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ function findLocalBinary(): string | undefined {
2626
if (!fs.existsSync(distDir)) return undefined
2727

2828
// Walk dist/ recursively — binary packages may be scoped (@altimateai/...)
29+
const binaryNames = process.platform === "win32" ? ["altimate.exe", "altimate"] : ["altimate"]
2930
function search(dir: string): string | undefined {
3031
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
3132
if (!entry.isDirectory()) continue
3233
const sub = path.join(dir, entry.name)
33-
const binPath = path.join(sub, "bin", "altimate")
34-
if (fs.existsSync(binPath)) return binPath
34+
for (const name of binaryNames) {
35+
const binPath = path.join(sub, "bin", name)
36+
if (fs.existsSync(binPath)) return binPath
37+
}
3538
// Recurse one level for scoped packages (e.g. @altimateai/)
3639
const nested = search(sub)
3740
if (nested) return nested
@@ -55,7 +58,7 @@ function resolveNodePath(): string {
5558
if (parent === current) break
5659
current = parent
5760
}
58-
return paths.join(":")
61+
return paths.join(path.delimiter)
5962
}
6063

6164
describe("compiled binary smoke test", () => {

0 commit comments

Comments
 (0)