publish.ts 343 B

12345678910111213141516171819
  1. #!/usr/bin/env bun
  2. const dir = new URL("..", import.meta.url).pathname
  3. process.chdir(dir)
  4. import { $ } from "bun"
  5. await import("./generate")
  6. await $`rm -rf dist`
  7. await $`bun tsc`
  8. const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
  9. if (snapshot) {
  10. await $`bun publish --tag snapshot`
  11. }
  12. if (!snapshot) {
  13. await $`bun publish`
  14. }