Skip to content

Commit 99bdfe5

Browse files
committed
fix: ensures environment is filled in even when reading APP_CONFIG
1 parent 68e60dc commit 99bdfe5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

app-config-config/src/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,18 @@ export async function loadUnvalidatedConfig({
8282

8383
verifyParsedValue(parsed);
8484

85-
return { parsed, fullConfig: parsed.toJSON() };
85+
return {
86+
parsed,
87+
fullConfig: parsed.toJSON(),
88+
// NOTE: not checking meta values here
89+
environment: currentEnvironment(
90+
asEnvOptions(
91+
environmentOverride,
92+
environmentAliasesArg ?? defaultAliases,
93+
environmentSourceNamesArg,
94+
),
95+
),
96+
};
8697
} catch (error) {
8798
// having no APP_CONFIG environment variable is normal, and should fall through to reading files
8899
if (!NotFoundError.isNotFoundError(error)) throw error;

0 commit comments

Comments
 (0)