mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(manager/copier): process update templates outside repository root (#30708)
This commit is contained in:
parent
bb9bbcb3c3
commit
0803b46d23
2 changed files with 26 additions and 1 deletions
|
@ -118,6 +118,29 @@ describe('modules/manager/copier/artifacts', () => {
|
||||||
expect(execSnapshots).toMatchObject([
|
expect(execSnapshots).toMatchObject([
|
||||||
{
|
{
|
||||||
cmd: 'copier update --skip-answered --defaults --answers-file .copier-answers.yml --vcs-ref 1.1.0',
|
cmd: 'copier update --skip-answered --defaults --answers-file .copier-answers.yml --vcs-ref 1.1.0',
|
||||||
|
options: {
|
||||||
|
cwd: '/tmp/github/some/repo',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('invokes copier update with nested destination and answer file', async () => {
|
||||||
|
const execSnapshots = mockExecAll();
|
||||||
|
|
||||||
|
await updateArtifacts({
|
||||||
|
packageFileName: 'apps/my-app/.copier-answers.yml',
|
||||||
|
updatedDeps: upgrades,
|
||||||
|
newPackageFileContent: '',
|
||||||
|
config: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(execSnapshots).toMatchObject([
|
||||||
|
{
|
||||||
|
cmd: 'copier update --skip-answered --defaults --answers-file .copier-answers.yml --vcs-ref 1.1.0',
|
||||||
|
options: {
|
||||||
|
cwd: '/tmp/github/some/repo/apps/my-app',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { quote } from 'shlex';
|
import { quote } from 'shlex';
|
||||||
|
import upath from 'upath';
|
||||||
import { GlobalConfig } from '../../../config/global';
|
import { GlobalConfig } from '../../../config/global';
|
||||||
import { logger } from '../../../logger';
|
import { logger } from '../../../logger';
|
||||||
import { exec } from '../../../util/exec';
|
import { exec } from '../../../util/exec';
|
||||||
|
@ -28,7 +29,7 @@ function buildCommand(
|
||||||
}
|
}
|
||||||
command.push(
|
command.push(
|
||||||
'--answers-file',
|
'--answers-file',
|
||||||
quote(packageFileName),
|
quote(upath.basename(packageFileName)),
|
||||||
'--vcs-ref',
|
'--vcs-ref',
|
||||||
quote(newVersion),
|
quote(newVersion),
|
||||||
);
|
);
|
||||||
|
@ -72,6 +73,7 @@ export async function updateArtifacts({
|
||||||
|
|
||||||
const command = buildCommand(config, packageFileName, newVersion);
|
const command = buildCommand(config, packageFileName, newVersion);
|
||||||
const execOptions: ExecOptions = {
|
const execOptions: ExecOptions = {
|
||||||
|
cwdFile: packageFileName,
|
||||||
docker: {},
|
docker: {},
|
||||||
userConfiguredEnv: config.env,
|
userConfiguredEnv: config.env,
|
||||||
toolConstraints: [
|
toolConstraints: [
|
||||||
|
|
Loading…
Reference in a new issue