mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
parent
04289fb158
commit
2e0e69c954
2 changed files with 9 additions and 2 deletions
|
@ -20,7 +20,7 @@ delete process.env.NPM_CONFIG_CACHE;
|
||||||
describe('generateLockFile', () => {
|
describe('generateLockFile', () => {
|
||||||
let config: PostUpdateConfig;
|
let config: PostUpdateConfig;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
config = { cacheDir: 'some-cache-dir' };
|
config = { cacheDir: 'some-cache-dir', compatibility: { pnpm: '^2.0.0' } };
|
||||||
env.getChildProcessEnv.mockReturnValue(envMock.basic);
|
env.getChildProcessEnv.mockReturnValue(envMock.basic);
|
||||||
});
|
});
|
||||||
it('generates lock files', async () => {
|
it('generates lock files', async () => {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { readFile } from 'fs-extra';
|
import { readFile } from 'fs-extra';
|
||||||
|
import { validRange } from 'semver';
|
||||||
|
import { quote } from 'shlex';
|
||||||
import { join } from 'upath';
|
import { join } from 'upath';
|
||||||
import { logger } from '../../../logger';
|
import { logger } from '../../../logger';
|
||||||
import { ExecOptions, exec } from '../../../util/exec';
|
import { ExecOptions, exec } from '../../../util/exec';
|
||||||
|
@ -23,7 +25,12 @@ export async function generateLockFile(
|
||||||
let stderr: string;
|
let stderr: string;
|
||||||
let cmd = 'pnpm';
|
let cmd = 'pnpm';
|
||||||
try {
|
try {
|
||||||
const preCommands = ['npm i -g pnpm'];
|
let installPnpm = 'npm i -g pnpm';
|
||||||
|
const pnpmCompatibility = config.compatibility?.pnpm;
|
||||||
|
if (validRange(pnpmCompatibility)) {
|
||||||
|
installPnpm += `@${quote(pnpmCompatibility)}`;
|
||||||
|
}
|
||||||
|
const preCommands = [installPnpm];
|
||||||
const tagConstraint = await getNodeConstraint(config);
|
const tagConstraint = await getNodeConstraint(config);
|
||||||
const execOptions: ExecOptions = {
|
const execOptions: ExecOptions = {
|
||||||
cwd,
|
cwd,
|
||||||
|
|
Loading…
Reference in a new issue