Skip to content

Commit

Permalink
feat: update release task function to accept version parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
a145789 committed Jul 16, 2024
1 parent 6399e84 commit e2b6ead
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ interface ReleaseCommandOptions {
skipChangelog?: boolean
skipGitTag?: boolean
npmTag?: string
task?(): Promise<void>
task?(newVersion: string, oldVersion: string): Promise<void>
}
function release(options: ReleaseCommandOptions): Promise<void>

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ interface ReleaseCommandOptions {
skipChangelog?: boolean
skipGitTag?: boolean
npmTag?: string
task?(): Promise<void>
task?(newVersion: string, oldVersion: string): Promise<void>
}
function release(options: ReleaseCommandOptions): Promise<void>

Expand Down
4 changes: 2 additions & 2 deletions src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export interface ReleaseCommandOptions {
skipChangelog?: boolean
skipGitTag?: boolean
checkRemoteVersion?: boolean
task?(): Promise<void>
task?(newVersion: string, oldVersion: string): Promise<void>
}

export async function release(options: ReleaseCommandOptions) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e2b6ead

Please sign in to comment.