fix: prepare script

This commit is contained in:
orion 2024-04-30 14:10:49 -05:00
parent 58833c2743
commit bf6975f014
Signed by: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -4,8 +4,10 @@ import { execSync } from 'child_process'
let ver = process.argv[2]
if (!ver) {
console.error(`tag required: bun bun/prepare.js v1.0.0`)
process.exit(1)
} else if (!/v\d+\.\d+\.\d+/.test(ver)) {
console.error(`invalid tag: ${ver}`)
process.exit(1)
}
ver = (/\d+\.\d+\.\d+/.exec(ver) || [])[0] || ''
@ -20,8 +22,8 @@ await writeFile('./spago.yaml', spagonew)
const readme = await readFile('./README.md', 'utf8')
const readmenew = readme.replace(
/packages\/purescript-postgresql\/.+?\//g,
`/packages/purescript-postgresql/${ver}/`,
/packages\/purescript-csv-stream\/.+?\//g,
`/packages/purescript-csv-stream/${ver}/`,
)
await writeFile('./README.md', readmenew)