Skip to content
Snippets Groups Projects
Unverified Commit 0803b46d authored by Philipp Jaschke's avatar Philipp Jaschke Committed by GitHub
Browse files

fix(manager/copier): process update templates outside repository root (#30708)

parent bb9bbcb3
No related branches found
No related tags found
No related merge requests found
......@@ -118,6 +118,29 @@ describe('modules/manager/copier/artifacts', () => {
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',
},
},
]);
});
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',
},
},
]);
});
......
import { quote } from 'shlex';
import upath from 'upath';
import { GlobalConfig } from '../../../config/global';
import { logger } from '../../../logger';
import { exec } from '../../../util/exec';
......@@ -28,7 +29,7 @@ function buildCommand(
}
command.push(
'--answers-file',
quote(packageFileName),
quote(upath.basename(packageFileName)),
'--vcs-ref',
quote(newVersion),
);
......@@ -72,6 +73,7 @@ export async function updateArtifacts({
const command = buildCommand(config, packageFileName, newVersion);
const execOptions: ExecOptions = {
cwdFile: packageFileName,
docker: {},
userConfiguredEnv: config.env,
toolConstraints: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment