mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
fix: stop rewriting dev during release publish (#22982)
This commit is contained in:
parent
3573019916
commit
24fb9b1296
5 changed files with 120 additions and 50 deletions
|
|
@ -6,9 +6,19 @@ import { fileURLToPath } from "url"
|
|||
const dir = fileURLToPath(new URL("..", import.meta.url))
|
||||
process.chdir(dir)
|
||||
|
||||
async function published(name: string, version: string) {
|
||||
return (await $`npm view ${name}@${version} version`.nothrow()).exitCode === 0
|
||||
}
|
||||
|
||||
await $`bun tsc`
|
||||
const pkg = await import("../package.json").then((m) => m.default)
|
||||
const pkg = await import("../package.json").then(
|
||||
(m) => m.default as { name: string; version: string; exports: Record<string, string> },
|
||||
)
|
||||
const original = JSON.parse(JSON.stringify(pkg))
|
||||
if (await published(pkg.name, pkg.version)) {
|
||||
console.log(`already published ${pkg.name}@${pkg.version}`)
|
||||
process.exit(0)
|
||||
}
|
||||
for (const [key, value] of Object.entries(pkg.exports)) {
|
||||
const file = value.replace("./src/", "./dist/").replace(".ts", "")
|
||||
// @ts-ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue