Skip to content

Commit

Permalink
fix(core): ensure plugin testing uses correct pm for install
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Nov 6, 2023
1 parent 1d62dce commit 967f39b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/plugin/src/utils/testing-utils/nx-project.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { workspaceRoot } from '@nx/devkit';
import { detectPackageManager, workspaceRoot } from '@nx/devkit';
import {
getPackageManagerCommand,
readJsonFile,
Expand Down Expand Up @@ -50,9 +50,10 @@ export function uniq(prefix: string) {
* @param silent silent output from the install
*/
export function runPackageManagerInstall(silent: boolean = true) {
const pmc = getPackageManagerCommand();
const cwd = tmpProjPath();
const pmc = getPackageManagerCommand(detectPackageManager(cwd));
const install = execSync(pmc.install, {
cwd: tmpProjPath(),
cwd,
...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
});
return install ? install.toString() : '';
Expand Down

0 comments on commit 967f39b

Please sign in to comment.