File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ import { fileExists } from '../filesystemUtilities'
99import { isNonNullable } from '../utilities/tsUtils'
1010import { getConfigFilename , getCredentialsFilename } from '../../auth/credentials/sharedCredentialsFile'
1111import { fs } from '../../shared/fs/fs'
12- import { waitUntil } from '../utilities/timeoutUtils'
13- import { isWin } from '../vscode/env'
1412
1513const header = `
1614# AWS credentials file used by AWS CLI, SDKs, and tools.
@@ -100,9 +98,5 @@ export class UserCredentialsUtils {
10098 }
10199
102100 await fs . writeFile ( dest , contents . join ( '\n' ) )
103- // Windows Race condition with writing files.
104- if ( isWin ( ) ) {
105- await waitUntil ( ( ) => fs . exists ( dest ) , { timeout : 5000 , interval : 100 } )
106- }
107101 }
108102}
Original file line number Diff line number Diff line change @@ -304,6 +304,9 @@ export class FileSystem {
304304 }
305305
306306 await write ( uri )
307+ if ( isWin ( ) ) {
308+ await waitUntil ( async ( ) => await fs . exists ( uri ) , { timeout : 5000 , truthy : true } )
309+ }
307310 }
308311
309312 /**
@@ -428,7 +431,7 @@ export class FileSystem {
428431 } )
429432 }
430433
431- return vfs . delete ( uri , opt ) . then ( undefined , async ( err ) => {
434+ vfs . delete ( uri , opt ) . then ( undefined , async ( err ) => {
432435 const notFound = isFileNotFoundError ( err )
433436
434437 if ( notFound && opt . force ) {
@@ -461,6 +464,11 @@ export class FileSystem {
461464
462465 throw err
463466 } )
467+
468+ // Windows race condition
469+ if ( isWin ( ) ) {
470+ await waitUntil ( async ( ) => ! ( await fs . exists ( fileOrDir ) ) , { timeout : 5000 , truthy : true } )
471+ }
464472 }
465473
466474 async readdir ( uri : vscode . Uri | string ) : Promise < [ string , vscode . FileType ] [ ] > {
You can’t perform that action at this time.
0 commit comments