Skip to content

Commit 12cebf0

Browse files
committed
require volta config
1 parent 90470c6 commit 12cebf0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dev-packages/e2e-tests/lib/copyToTemp.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,15 @@ function fixPackageJson(cwd: string): void {
2727
}
2828

2929
// 2. Fix volta extends
30-
if (packageJson.volta?.extends === '../../package.json') {
31-
const newPath = join(__dirname, '../package.json');
30+
if (!packageJson.volta) {
31+
throw new Error('No volta config found, please provide one!');
32+
}
33+
34+
if (typeof packageJson.volta.extends === 'string') {
35+
const extendsPath = packageJson.volta.extends;
36+
// We add a virtual dir to ensure that the relative depth is consistent
37+
// dirPath is relative to ./../test-applications/xxx
38+
const newPath = join(__dirname, 'virtual-dir/', extendsPath);
3239
packageJson.volta.extends = newPath;
3340
console.log(`Fixed volta.extends to ${newPath}`);
3441
} else {

0 commit comments

Comments
 (0)