summaryrefslogtreecommitdiffhomepage
path: root/packages/sdk/js/script/publish.ts
blob: 389a9376c66ccef85b695aca462a43e6aa354c7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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`
}