backend-manager 2.4.6 → 2.4.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "2.4.6",
3
+ "version": "2.4.7",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -75,6 +75,7 @@ Manager.prototype.init = function (exporter, options) {
75
75
  self.options = options;
76
76
  self.project = options.firebaseConfig || JSON.parse(process.env.FIREBASE_CONFIG || '{}');
77
77
  self.project.resourceZone = options.resourceZone;
78
+ self.project.serviceAccountPath = path.resolve(self.cwd, options.serviceAccountPath)
78
79
 
79
80
  self.cwd = process.cwd();
80
81
  self.package = resolveProjectPackage();
@@ -86,13 +87,13 @@ Manager.prototype.init = function (exporter, options) {
86
87
  // Init assistant
87
88
  self.assistant = self.Assistant().init(undefined, options.assistant);
88
89
 
89
- process.env.ENVIRONMENT = !process.env.ENVIRONMENT ? self.assistant.meta.environment : process.env.ENVIRONMENT;
90
-
91
90
  // set more properties (need to wait for assistant to determine if DEV)
92
91
  self.project.functionsUrl = self.assistant.meta.environment === 'development'
93
92
  ? `http://localhost:5001/${self.project.projectId}/${self.project.resourceZone}`
94
93
  : `https://${self.project.resourceZone}-${self.project.projectId}.cloudfunctions.net`;
95
94
 
95
+ process.env.ENVIRONMENT = !process.env.ENVIRONMENT ? self.assistant.meta.environment : process.env.ENVIRONMENT;
96
+
96
97
  // Use the working Firebase logger that they disabled for whatever reason
97
98
  if (self.assistant.meta.environment !== 'development' && options.useFirebaseLogger) {
98
99
  require('firebase-functions/lib/logger/compat');
@@ -137,7 +138,7 @@ Manager.prototype.init = function (exporter, options) {
137
138
  } else {
138
139
  self.libraries.initializedAdmin = self.libraries.admin.initializeApp({
139
140
  credential: self.libraries.admin.credential.cert(
140
- require(path.resolve(self.cwd, options.serviceAccountPath))
141
+ require(self.project.serviceAccountPath)
141
142
  ),
142
143
  databaseURL: self.project.databaseURL,
143
144
  }, options.uniqueAppName);