From 96705b2893dd0d1ae11936773ddd8a93c69327eb Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Thu, 15 Feb 2024 23:08:16 +0800 Subject: [PATCH] chore: get all options --- packages/release-it-pnpm/src/index.js | 6 +++++- packages/release-it-pnpm/src/index.test.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/release-it-pnpm/src/index.js b/packages/release-it-pnpm/src/index.js index e43a736..40e5b1d 100644 --- a/packages/release-it-pnpm/src/index.js +++ b/packages/release-it-pnpm/src/index.js @@ -30,6 +30,10 @@ class ReleaseItPnpmPlugin extends Plugin { return 'npm' } + getInitialOptions(options) { + return options + } + async bump(newVersion) { const cwd = process.cwd() const pnpmWorkspaces = path.join(cwd, 'pnpm-workspace.yaml') @@ -78,7 +82,7 @@ class ReleaseItPnpmPlugin extends Plugin { pkg.version = newVersion await this.step({ task: async () => { - if (this.options['dry-run']) { + if (!this.options['dry-run']) { fs.writeFileSync(absPath, JSON.stringify(pkg, null, 2)) } }, diff --git a/packages/release-it-pnpm/src/index.test.js b/packages/release-it-pnpm/src/index.test.js index 038c612..6bcf0fe 100644 --- a/packages/release-it-pnpm/src/index.test.js +++ b/packages/release-it-pnpm/src/index.test.js @@ -6,7 +6,7 @@ import Plugin from './index.js' const namespace = 'release-it-pnpm' describe('release-it-pnpm', () => { - const options = { [namespace]: {} } + const options = { [namespace]: {}, 'dry-run': true } const plugin = factory(Plugin, { namespace, options,