Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure fs deletes are not cwd dependent #59570

Merged
merged 1 commit into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli_plugin/install/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/remove/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,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}]`);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
});
}