Skip to content

Commit

Permalink
sandbox - enable graceful-fs in main process too (#132282)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Oct 20, 2021
1 parent 2f57482 commit 2e112c7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/vs/code/electron-main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/

import { app, dialog } from 'electron';
import { unlinkSync } from 'fs';
import * as fs from 'fs';
import { gracefulify } from 'graceful-fs';
import { coalesce, distinct } from 'vs/base/common/arrays';
import { Promises } from 'vs/base/common/async';
import { toErrorMessage } from 'vs/base/common/errorMessage';
Expand Down Expand Up @@ -70,6 +71,12 @@ import 'vs/platform/update/common/update.config.contribution';
*/
class CodeMain {

constructor() {

// Enable gracefulFs
gracefulify(fs);
}

main(): void {
try {
this.startup();
Expand Down Expand Up @@ -277,7 +284,7 @@ class CodeMain {
// let's delete it, since we can't connect to it and then
// retry the whole thing
try {
unlinkSync(environmentMainService.mainIPCHandle);
fs.unlinkSync(environmentMainService.mainIPCHandle);
} catch (error) {
logService.warn('Could not delete obsolete instance handle', error);

Expand Down

0 comments on commit 2e112c7

Please sign in to comment.