Skip to content

Commit 0f92bfe

Browse files
committed
implement waitUntil on windows
1 parent fc8a1c6 commit 0f92bfe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/core/src/shared/credentials/userCredentialsUtils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { fileExists } from '../filesystemUtilities'
99
import { isNonNullable } from '../utilities/tsUtils'
1010
import { getConfigFilename, getCredentialsFilename } from '../../auth/credentials/sharedCredentialsFile'
1111
import { fs } from '../../shared/fs/fs'
12+
import { waitUntil } from '../utilities/timeoutUtils'
13+
import { isWin } from '../vscode/env'
1214

1315
const header = `
1416
# AWS credentials file used by AWS CLI, SDKs, and tools.
@@ -98,5 +100,9 @@ export class UserCredentialsUtils {
98100
}
99101

100102
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+
}
101107
}
102108
}

0 commit comments

Comments
 (0)