opencode/packages/sdk/js/script/publish.ts
2025-08-03 10:42:52 -04:00

19 lines
343 B
TypeScript

#!/usr/bin/env bun
const dir = new URL("..", import.meta.url).pathname
process.chdir(dir)
import { $ } from "bun"
await import("./generate")
await $`rm -rf dist`
await $`bun tsc`
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
if (snapshot) {
await $`bun publish --tag snapshot`
}
if (!snapshot) {
await $`bun publish`
}