backend-manager 3.2.121 → 3.2.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/manager/index.js +11 -7
package/package.json
CHANGED
package/src/manager/index.js
CHANGED
|
@@ -99,9 +99,9 @@ Manager.prototype.init = function (exporter, options) {
|
|
|
99
99
|
// Load config
|
|
100
100
|
self.config = merge(
|
|
101
101
|
// Load basic config
|
|
102
|
-
requireJSON5(self.project.backendManagerConfigPath),
|
|
102
|
+
requireJSON5(self.project.backendManagerConfigPath, true),
|
|
103
103
|
// Load ENV config as a fallback
|
|
104
|
-
requireJSON5(path.resolve(self.cwd, '.runtimeconfig.json'),
|
|
104
|
+
requireJSON5(path.resolve(self.cwd, '.runtimeconfig.json'), options.projectType === 'firebase'),
|
|
105
105
|
// Finally, load the functions config
|
|
106
106
|
self.libraries.functions
|
|
107
107
|
? self.libraries.functions.config()
|
|
@@ -984,17 +984,21 @@ function resolveProjectPackage() {
|
|
|
984
984
|
} catch (e) {}
|
|
985
985
|
}
|
|
986
986
|
|
|
987
|
-
function requireJSON5(file,
|
|
988
|
-
// Set
|
|
989
|
-
|
|
987
|
+
function requireJSON5(file, throwError) {
|
|
988
|
+
// Set throwError
|
|
989
|
+
throwError = typeof throwError === 'undefined' ? true : throwError;
|
|
990
990
|
|
|
991
991
|
// Load JSON5
|
|
992
992
|
try {
|
|
993
993
|
return JSON5.parse(jetpack.read(file))
|
|
994
994
|
} catch (e) {
|
|
995
|
-
|
|
996
|
-
|
|
995
|
+
// If we're not throwing an error, just return
|
|
996
|
+
if (!throwError) {
|
|
997
|
+
return {};
|
|
997
998
|
}
|
|
999
|
+
|
|
1000
|
+
// Otherwise, throw the error
|
|
1001
|
+
console.error(`Failed to load JSON at ${file}:`, e);
|
|
998
1002
|
throw e;
|
|
999
1003
|
}
|
|
1000
1004
|
}
|