Skip to content

Commit

Permalink
fix: updating url plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jun 1, 2018
1 parent cb3da43 commit 265fb9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ export default class Plugins {
const plugins = (await this.list()).filter((p): p is Config.PJSON.PluginTypes.User => p.type === 'user')
if (plugins.length === 0) return
cli.action.start(`${this.config.name}: Updating plugins`)
await this.yarn.exec(['upgrade'], {cwd: this.config.dataDir, verbose: this.verbose})
await this.yarn.exec(['add', ...plugins.map(p => `${p.name}@${p.tag}`)], {cwd: this.config.dataDir, verbose: this.verbose})
if (plugins.find(p => !!p.url)) {
await this.yarn.exec(['upgrade'], {cwd: this.config.dataDir, verbose: this.verbose})
}
const npmPlugins = plugins.filter(p => !p.url)
if (npmPlugins.length) {
await this.yarn.exec(['add', ...npmPlugins.map(p => `${p.name}@${p.tag}`)], {cwd: this.config.dataDir, verbose: this.verbose})
}
for (let p of plugins) {
await this.refresh(path.join(this.config.dataDir, 'node_modules', p.name))
}
Expand Down

0 comments on commit 265fb9a

Please sign in to comment.