Skip to content

Commit

Permalink
fix: can now install legacy plugins if @oclif/plugin-legacy in plugins (
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandagg authored Nov 8, 2023
1 parent cba84e7 commit 41566b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export default class Plugins {
if (p.valid) return true

if (
!this.config.plugins.get('@oclif/plugin-legacy') ||
this.config.plugins.get('@oclif/plugin-legacy') ||
// @ts-expect-error because _base is private
p._base.includes('@oclif/plugin-legacy')
) {
Expand Down
11 changes: 11 additions & 0 deletions test/integration/install.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,15 @@ describe('install/uninstall integration tests', () => {
expect(result.some((r) => r.name === '@oclif/plugin-test-esm-1')).to.be.false
})
})

describe('legacy plugin', () => {
it('should install legacy plugin', async () => {
await PluginsInstall.run(['@oclif/plugin-legacy'], cwd)
await PluginsInstall.run(['@heroku-cli/plugin-ps-exec', '--silent'], cwd)

const result = await PluginsIndex.run([], cwd)
expect(stdoutStub.calledWith(match('@heroku-cli/plugin-ps-exec'))).to.be.true
expect(result.some((r) => r.name === '@heroku-cli/plugin-ps-exec')).to.be.true
})
})
})

0 comments on commit 41566b6

Please sign in to comment.