From 7b217a45aac2aa44bc696054924ef2280ecdc944 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 30 Nov 2023 12:06:28 -0800 Subject: [PATCH] fix: cache this.commandsDir (#891) * fix: cache this.comnmandsDir * test: ignore-scripts for integration tests --- src/config/plugin.ts | 1 + test/integration/sf.e2e.ts | 3 +-- test/integration/util.ts | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/config/plugin.ts b/src/config/plugin.ts index 736abffcc..681d18e97 100644 --- a/src/config/plugin.ts +++ b/src/config/plugin.ts @@ -298,6 +298,7 @@ export class Plugin implements IPlugin { } private async getCommandsDir(): Promise { + if (this.commandsDir) return this.commandsDir this.commandsDir = await tsPath(this.root, this.pjson.oclif.commands, this) return this.commandsDir } diff --git a/test/integration/sf.e2e.ts b/test/integration/sf.e2e.ts index 50ab4d6ef..529941670 100644 --- a/test/integration/sf.e2e.ts +++ b/test/integration/sf.e2e.ts @@ -3,8 +3,7 @@ import {arch} from 'node:os' import {Executor, setup} from './util' -import StripAnsi = require('strip-ansi') -const stripAnsi: typeof StripAnsi = require('strip-ansi') +const stripAnsi = require('strip-ansi') const chalk = require('chalk') chalk.level = 0 diff --git a/test/integration/util.ts b/test/integration/util.ts index fc2c3066e..df0281694 100644 --- a/test/integration/util.ts +++ b/test/integration/util.ts @@ -186,9 +186,12 @@ export async function setup(testFile: string, options: SetupOptions): Promise