Skip to content

Commit

Permalink
chore(projects): update script
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Jul 31, 2024
1 parent 304af72 commit d585611
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ async function updateTemplateVersion() {

const { version: newVersion } = JSON.parse(pkgJson);

const pkgVersionReg = /"version": "\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?"/;

const soybeanJsCliVersionReg = /"@soybeanjs\/cli": "\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?"/;

for await (const glob of globs) {
const json = await readFile(glob, 'utf-8');

const newPkgJson = json.replace(soybeanJsCliVersionReg, `"@soybeanjs/cli": "${newVersion}"`);
const newPkgJson = json
.replace(pkgVersionReg, `"version": "0.0.0"`)
.replace(soybeanJsCliVersionReg, `"@soybeanjs/cli": "${newVersion}"`);

await writeFile(glob, newPkgJson);
}
Expand Down

0 comments on commit d585611

Please sign in to comment.