Skip to content

Commit

Permalink
feat: add refresh-cache hook (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 authored Sep 5, 2024
1 parent 4732603 commit 55e9aab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
"typescript": "^5.3.3"
},
"oclif": {
"commands": "./lib/commands"
"commands": "./lib/commands",
"hooks": {
"plugins:postinstall": "./lib/hooks/refresh-cache.js",
"plugins:postuninstall": "./lib/hooks/refresh-cache.js"
}
},
"prettier": {
"singleQuote": true
Expand Down
8 changes: 8 additions & 0 deletions src/hooks/refresh-cache.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {Hook} from '@oclif/core'

const hook: Hook<'refresh'> = async function (opts) {
// this `config` instance already have installed/uninstalled plugins loaded
await opts.config.runCommand('fzf-cmp', ['--refresh-cache'])
}

export default hook

0 comments on commit 55e9aab

Please sign in to comment.