generated from tpl/purs
fix: prep for publish
This commit is contained in:
parent
f9894f8889
commit
c9cdb9f60b
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# url-immutable
|
||||
Type-safe immutable bindings to the `URL` web / node api.
|
34
bun/prepare.js
Normal file
34
bun/prepare.js
Normal file
@ -0,0 +1,34 @@
|
||||
import { readFile, writeFile } from "fs/promises";
|
||||
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] || "";
|
||||
|
||||
const pkg = await readFile("./package.json", "utf8");
|
||||
const pkgnew = pkg.replace(/"version": ".+"/, `"version": "v${ver}"`);
|
||||
await writeFile("./package.json", pkgnew);
|
||||
|
||||
const spago = await readFile("./spago.yaml", "utf8");
|
||||
const spagonew = spago.replace(/version: .+/, `version: '${ver}'`);
|
||||
await writeFile("./spago.yaml", spagonew);
|
||||
|
||||
const readme = await readFile("./README.md", "utf8");
|
||||
const readmenew = readme.replace(
|
||||
/packages\/purescript-url-immutable\/.+?\//g,
|
||||
`/packages/purescript-url-immutable/${ver}/`,
|
||||
);
|
||||
await writeFile("./README.md", readmenew);
|
||||
|
||||
execSync(`git add spago.yaml package.json README.md`);
|
||||
execSync(`git commit -m 'chore: prepare v${ver}'`);
|
||||
execSync(`git tag v${ver}`);
|
||||
execSync(`git push --tags`);
|
||||
execSync(`git push --mirror github-mirror`);
|
@ -2,6 +2,12 @@ package:
|
||||
build:
|
||||
strict: true
|
||||
pedanticPackages: true
|
||||
publish:
|
||||
version: '0.0.0'
|
||||
license: 'GPL-3.0-or-later'
|
||||
location:
|
||||
githubOwner: 'cakekindel'
|
||||
githubRepo: 'purescript-url-immutable'
|
||||
name: url-immutable
|
||||
test:
|
||||
main: Test.Main
|
||||
|
Loading…
Reference in New Issue
Block a user