Skip to content

W-17482601 feat: add finally hook#1276

Merged
iowillhoit merged 1 commit intomainfrom
mdonnalley/finally-hook
Dec 20, 2024
Merged

W-17482601 feat: add finally hook#1276
iowillhoit merged 1 commit intomainfrom
mdonnalley/finally-hook

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
@iowillhoit iowillhoit deleted the mdonnalley/finally-hook branch December 20, 2024 18:41
@iowillhoit iowillhoit changed the title feat: add finally hook W-17482601 feat: add finally hook Jan 27, 2025
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