fix(lock): nicer lockfile error (#4396)
This commit is contained in:
parent
732e83f48d
commit
dd3d49339d
|
|
@ -41,6 +41,7 @@ export async function installBrowsersWithProgressBar(packagePath: string) {
|
||||||
|
|
||||||
const browsersPath = browserPaths.browsersPath(packagePath);
|
const browsersPath = browserPaths.browsersPath(packagePath);
|
||||||
await fsMkdirAsync(browsersPath, { recursive: true });
|
await fsMkdirAsync(browsersPath, { recursive: true });
|
||||||
|
const lockfilePath = path.join(browsersPath, '__dirlock');
|
||||||
const releaseLock = await lockfile.lock(browsersPath, {
|
const releaseLock = await lockfile.lock(browsersPath, {
|
||||||
retries: {
|
retries: {
|
||||||
retries: 10,
|
retries: 10,
|
||||||
|
|
@ -49,7 +50,10 @@ export async function installBrowsersWithProgressBar(packagePath: string) {
|
||||||
// See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions
|
// See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions
|
||||||
factor: 1.27579,
|
factor: 1.27579,
|
||||||
},
|
},
|
||||||
lockfilePath: path.join(browsersPath, '__dirlock'),
|
onCompromised: (err: Error) => {
|
||||||
|
throw new Error(`${err.message} Path: ${lockfilePath}`);
|
||||||
|
},
|
||||||
|
lockfilePath,
|
||||||
});
|
});
|
||||||
const linksDir = path.join(browsersPath, '.links');
|
const linksDir = path.join(browsersPath, '.links');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue