Skip to content

feat: execute could receive a function#54

Merged
antfu merged 1 commit intoantfu-collective:mainfrom
s3xysteak:main
Oct 28, 2024
Merged

feat: execute could receive a function#54
antfu merged 1 commit intoantfu-collective:mainfrom
s3xysteak:main

Conversation

@s3xysteak
Copy link
Copy Markdown

Description

The PR makes execute option could receive a function.

pnpm bumpp --execute="echo foo"
export defualt defineConfig({
  execute: 'echo foo'
})

It does not change the before behavior. But it makes users could pass a function in bump.config.ts:

export defualt defineConfig({
  // execute: 'echo foo'

  execute: (config) => {
    console.log('bar', config.results.newVersion)
    // also could be an async function
  }
})

Linked Issues

Closes #53. Related #10.

Additional context

The log messages may need improvement:
src/version-bump.ts

console.log(` execute ${c.bold(typeof operation.options.execute === 'function' ? 'function' : operation.options.execute)}`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function options.execute to make bumpp more flexible

2 participants