From 41566b6a9d446f4b446ee1cf430e0c29203c0f17 Mon Sep 17 00:00:00 2001 From: RyanDagg Date: Wed, 8 Nov 2023 12:55:07 -0700 Subject: [PATCH] fix: can now install legacy plugins if @oclif/plugin-legacy in plugins (#708) --- src/plugins.ts | 2 +- test/integration/install.integration.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins.ts b/src/plugins.ts index cff6bed2..3c7572ff 100644 --- a/src/plugins.ts +++ b/src/plugins.ts @@ -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') ) { diff --git a/test/integration/install.integration.ts b/test/integration/install.integration.ts index 0c9a08e7..10dbaf24 100644 --- a/test/integration/install.integration.ts +++ b/test/integration/install.integration.ts @@ -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 + }) + }) })