Skip to content

Commit 835b577

Browse files
authored
Merge 0791bc6 into 0a112bd
2 parents 0a112bd + 0791bc6 commit 835b577

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

packages/util/src/defaults.ts

+1-21
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,13 @@ const getDefaultsFromGlobal = (): FirebaseDefaults | undefined =>
5757
* process.env.__FIREBASE_DEFAULTS_PATH__
5858
*/
5959
const getDefaultsFromEnvVariable = (): FirebaseDefaults | undefined => {
60-
if (typeof process === 'undefined') {
60+
if (typeof process === 'undefined' || typeof process.env === 'undefined') {
6161
return;
6262
}
6363
const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__;
64-
const defaultsJsonPath = process.env.__FIREBASE_DEFAULTS_PATH__;
6564
if (defaultsJsonString) {
66-
if (defaultsJsonPath) {
67-
console.warn(
68-
`Values were provided for both __FIREBASE_DEFAULTS__ ` +
69-
`and __FIREBASE_DEFAULTS_PATH__. __FIREBASE_DEFAULTS_PATH__ ` +
70-
`will be ignored.`
71-
);
72-
}
7365
return JSON.parse(defaultsJsonString);
7466
}
75-
if (defaultsJsonPath && typeof require !== 'undefined') {
76-
try {
77-
// eslint-disable-next-line @typescript-eslint/no-require-imports
78-
const json = require(defaultsJsonPath);
79-
return json;
80-
} catch (e) {
81-
console.warn(
82-
`Unable to read defaults from file provided to ` +
83-
`__FIREBASE_DEFAULTS_PATH__: ${defaultsJsonPath}`
84-
);
85-
}
86-
}
8767
};
8868

8969
const getDefaultsFromCookie = (): FirebaseDefaults | undefined => {

0 commit comments

Comments
 (0)