Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: execute could receive a function #54

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

s3xysteak
Copy link

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)}`)

@antfu antfu merged commit e05fac1 into antfu-collective:main Oct 28, 2024
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