ensure fs deletes are not cwd dependent (#59570)
Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
parent
0d3dd97691
commit
76c205cd1e
|
@ -27,7 +27,7 @@ export function cleanPrevious(settings, logger) {
|
|||
|
||||
logger.log('Found previous install attempt. Deleting...');
|
||||
try {
|
||||
del.sync(settings.workingPath);
|
||||
del.sync(settings.workingPath, { force: true });
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export default async function install(settings, logger) {
|
|||
|
||||
await extract(settings, logger);
|
||||
|
||||
del.sync(settings.tempArchiveFile);
|
||||
del.sync(settings.tempArchiveFile, { force: true });
|
||||
|
||||
existingInstall(settings, logger);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ export default function remove(settings, logger) {
|
|||
}
|
||||
|
||||
logger.log(`Removing ${settings.plugin}...`);
|
||||
del.sync(settings.pluginPath);
|
||||
del.sync(settings.pluginPath, { force: true });
|
||||
logger.log('Plugin removal complete');
|
||||
} catch (err) {
|
||||
logger.error(`Unable to remove plugin because of error: "${err.message}"`);
|
||||
|
|
|
@ -168,7 +168,7 @@ export class HeadlessChromiumDriverFactory {
|
|||
logger.debug(`deleting chromium user data directory at [${userDataDir}]`);
|
||||
// the unsubscribe function isn't `async` so we're going to make our best effort at
|
||||
// deleting the userDataDir and if it fails log an error.
|
||||
del(userDataDir).catch(error => {
|
||||
del(userDataDir, { force: true }).catch(error => {
|
||||
logger.error(`error deleting user data directory at [${userDataDir}]: [${error}]`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,7 +31,7 @@ export async function clean(dir: string, expectedPaths: string[]) {
|
|||
const path = resolvePath(dir, filename);
|
||||
if (!expectedPaths.includes(path)) {
|
||||
log(`Deleting unexpected file ${path}`);
|
||||
await del(path);
|
||||
await del(path, { force: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue