Skip to content

Commit

Permalink
feat: plugins:preinstall hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Bergman committed Oct 2, 2018
1 parent ca4af8a commit 2ba5ef0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"yarn": "^1.10.1"
},
"devDependencies": {
"@oclif/config": "^1.7.6",
"@oclif/config": "^1.8.1",
"@oclif/dev-cli": "^1.18.1",
"@oclif/errors": "^1.2.1",
"@oclif/plugin-help": "^2.1.2",
Expand Down
3 changes: 3 additions & 0 deletions src/commands/plugins/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ e.g. If you have a core plugin that has a 'hello' command, installing a user-ins
let plugin
if (p.type === 'npm') {
cli.action.start(`Installing plugin ${chalk.cyan(this.plugins.friendlyName(p.name))}`)
await this.config.runHook('plugins:preinstall', {
plugin: p
})
plugin = await this.plugins.install(p.name, p.tag)
} else {
cli.action.start(`Installing plugin ${chalk.cyan(p.url)}`)
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
debug "^4.0.1"
tslib "^1.9.3"

"@oclif/config@^1.8.1":
version "1.8.1"
resolved "https://registry.npmjs.org/@oclif/config/-/config-1.8.1.tgz#d23b49871c9a52e8e5050cdbd30b36d4774e66d8"
integrity sha512-KamkrumohhNSrACpkynJGHM4QfBrWkz4X4mbvhoUMHPORBUVtyUMIJhMnX/ND9DqmBsR3z7aP+QyxJS3aoUU3w==
dependencies:
debug "^4.0.1"
tslib "^1.9.3"

"@oclif/dev-cli@^1.18.1":
version "1.18.1"
resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.18.1.tgz#e53a6fa13749262e0fe2495e59e7e2fa38c356d5"
Expand Down

0 comments on commit 2ba5ef0

Please sign in to comment.