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: add finally hook #1276

Merged
merged 1 commit into from
Dec 20, 2024
Merged

feat: add finally hook #1276

merged 1 commit into from
Dec 20, 2024

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Dec 20, 2024

Add finally hook that will run at the end of every command execution - regardless of success or failure.

Usage

// src/hooks/finally.ts
import {Hook} from '@oclif/core'

const hook: Hook.Finally = async function (opts) {
  this.log(`I finally finished running ${opts.id} with args: ${opts.argv.join(' ')}`)
}

export default hook

Issues

Closes #1275
Closes #1263
Closes #1264
@W-17482601@

@iowillhoit iowillhoit merged commit b79ac41 into main Dec 20, 2024
88 checks passed
@iowillhoit iowillhoit deleted the mdonnalley/finally-hook branch December 20, 2024 18:41
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.

Hook to always run before termination Introduce deinit hook
2 participants