From e2b6eadc3b2c9de5aa4341ee48ff21264c2c3a26 Mon Sep 17 00:00:00 2001 From: a145789 <2091927351@qq.com> Date: Tue, 16 Jul 2024 13:47:31 +0800 Subject: [PATCH] feat: update release task function to accept version parameters --- README.md | 2 +- README.zh-CN.md | 2 +- src/release.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c7c28ab..a345fe5 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ interface ReleaseCommandOptions { skipChangelog?: boolean skipGitTag?: boolean npmTag?: string - task?(): Promise + task?(newVersion: string, oldVersion: string): Promise } function release(options: ReleaseCommandOptions): Promise diff --git a/README.zh-CN.md b/README.zh-CN.md index b240bc6..f5769ee 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -123,7 +123,7 @@ interface ReleaseCommandOptions { skipChangelog?: boolean skipGitTag?: boolean npmTag?: string - task?(): Promise + task?(newVersion: string, oldVersion: string): Promise } function release(options: ReleaseCommandOptions): Promise diff --git a/src/release.ts b/src/release.ts index da506e3..39ae0cf 100644 --- a/src/release.ts +++ b/src/release.ts @@ -192,7 +192,7 @@ export interface ReleaseCommandOptions { skipChangelog?: boolean skipGitTag?: boolean checkRemoteVersion?: boolean - task?(): Promise + task?(newVersion: string, oldVersion: string): Promise } export async function release(options: ReleaseCommandOptions) { @@ -227,7 +227,7 @@ export async function release(options: ReleaseCommandOptions) { updateVersion(expectVersion) if (options.task) { - await options.task() + await options.task(expectVersion, currentVersion) } if (!options.skipNpmPublish) {