Skip to content

Commit 080e99a

Browse files
committed
fix: Make async loop awaited
The forEach() loop was replaced with await Promise.all + map(), due to the presence of async inside.
1 parent 7bf41cc commit 080e99a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/platform.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function mergeEnvironments(parent: NodeJS.ProcessEnv, other: NodeJS
3434
if (isWindows) {
3535
// In Windows, environment variables are not case sensitive, so
3636
// this must be taken into account when overwriting.
37-
Object.entries(other).forEach(
37+
await Promise.all(Object.entries(other).map(
3838
async ([key, value]) => {
3939
if (value !== undefined) {
4040
let otherKey = key;
@@ -48,15 +48,15 @@ export async function mergeEnvironments(parent: NodeJS.ProcessEnv, other: NodeJS
4848
await _mergeEnvironmentValue(parent, otherKey, value, activeFile);
4949
}
5050
}
51-
);
51+
));
5252
} else {
53-
Object.entries(other).forEach(
53+
await Promise.all(Object.entries(other).map(
5454
async ([key, value]) => {
5555
if (value !== undefined) {
5656
await _mergeEnvironmentValue(parent, key, value, activeFile);
5757
}
5858
}
59-
);
59+
));
6060
}
6161
}
6262

0 commit comments

Comments
 (0)