Skip to content

Commit

Permalink
fix: cache this.commandsDir (#891)
Browse files Browse the repository at this point in the history
* fix: cache this.comnmandsDir

* test: ignore-scripts for integration tests
  • Loading branch information
mdonnalley committed Nov 30, 2023
1 parent fcbcb32 commit 7b217a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/config/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export class Plugin implements IPlugin {
}

private async getCommandsDir(): Promise<string | undefined> {
if (this.commandsDir) return this.commandsDir
this.commandsDir = await tsPath(this.root, this.pjson.oclif.commands, this)
return this.commandsDir
}
Expand Down
3 changes: 1 addition & 2 deletions test/integration/sf.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions test/integration/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,12 @@ export async function setup(testFile: string, options: SetupOptions): Promise<Ex
executor.debug(`${bin}_CONFIG_DIR:`, process.env[`${bin}_CONFIG_DIR`])
executor.debug(`${bin}_CACHE_DIR:`, process.env[`${bin}_CACHE_DIR`])

const yarnInstallRes = await executor.executeInTestDir('yarn install --force --network-timeout 600000', {
silent: false,
})
const yarnInstallRes = await executor.executeInTestDir(
'yarn install --force --network-timeout 600000 --ignore-scripts',
{
silent: false,
},
)
if (yarnInstallRes.code !== 0) {
console.error(yarnInstallRes?.error)
throw new Error('Failed to run `yarn install --force`')
Expand Down

0 comments on commit 7b217a4

Please sign in to comment.