Skip to content

Commit

Permalink
implement waitUntil on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Hweinstock committed Nov 12, 2024
1 parent fc8a1c6 commit 0f92bfe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/shared/credentials/userCredentialsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { fileExists } from '../filesystemUtilities'
import { isNonNullable } from '../utilities/tsUtils'
import { getConfigFilename, getCredentialsFilename } from '../../auth/credentials/sharedCredentialsFile'
import { fs } from '../../shared/fs/fs'
import { waitUntil } from '../utilities/timeoutUtils'
import { isWin } from '../vscode/env'

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

await fs.writeFile(dest, contents.join('\n'))
// Windows Race condition with writing files.
if (isWin()) {
await waitUntil(() => fs.exists(dest), { timeout: 5000, interval: 100 })
}
}
}

0 comments on commit 0f92bfe

Please sign in to comment.