Skip to content

Commit

Permalink
release: v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BIYUEHU committed Dec 31, 2023
1 parent fbfc67a commit 6d0b643
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { resolve } from 'path';
const config = {
branch: 'master',
remote: 'origin',
// registry: 'https://registry.npmjs.org/',
registry: 'https://registry.npmjs.org/',
main: 'kotori-bot',
root: '@kotori-bot/root',
sync: ['@kotori-bot/core'],
Expand Down Expand Up @@ -155,7 +155,7 @@ type Option = {
await setVersions(packages);

/* Lifecycle: beforeAddcommit */
log('Run eslint and prettier...');
log('Run eslint, prettier and conventional-changelog...');
await hooks(config.hooks.beforeAddcommit);

/* Step: spawn tag */
Expand All @@ -170,7 +170,7 @@ type Option = {
message: 'Do you need zip main package?',
default: true,
});
if (answer.value) await step(`pnpm pack --pack-destination "${ROOT_DIR}"`, undefined, { cwd: mainPkg.dir });
if (answer.value) await step('pnpm pack --pack-destination', [ROOT_DIR], { cwd: mainPkg.dir });
}

/* Step: push to remote branch */
Expand All @@ -194,11 +194,12 @@ type Option = {
/* Step: checkout registry and publish */
if (answer.publish) {
log('Publish...');
// const originRegistry = (await execa('pnpm config get registry')).stdout.replace(/(\n)|(\r)/g, '');
// await execa(`pnpm config set registry "${config.registry}"`);
const originRegistry = (await execa('pnpm config get registry')).stdout;
await execa('pnpm config set registry', [config.registry ?? originRegistry]);
await publishPackages(packages.filter(pkg => pkg.packageJson.private !== true));
// await execa(`pnpm config set registry "${originRegistry}"`);
await execa(`pnpm config set registry`, [originRegistry]);
}

/* ending */
if (!answer.push) log(`\nPlease enter "${pushCommand}"`);
log(`All ok!`);
Expand Down

0 comments on commit 6d0b643

Please sign in to comment.