Skip to content

Commit

Permalink
Fix bug where config variables are not available for emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenzlong committed Mar 8, 2018
1 parent f7250b1 commit b43ecca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/functionsEmulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var _pollOperation = function(op, controller) {

FunctionsEmulator.prototype.stop = function() {
delete process.env.FIREBASE_CONFIG;
delete process.env.FIREBASE_PROJECT;
delete process.env.GCLOUD_PROJECT;
var controller = this.controller;
return new RSVP.Promise(function(resolve) {
Expand Down Expand Up @@ -109,6 +110,7 @@ FunctionsEmulator.prototype.start = function(shellMode) {
return functionsConfig.getFirebaseConfig(options)
.then(function(result) {
process.env.FIREBASE_CONFIG = JSON.stringify(result);
process.env.FIREBASE_PROJECT = JSON.stringify(result); // To make pre-1.0 firebase-functions SDK work
process.env.GCLOUD_PROJECT = projectId;
logger.debug('Starting @google-cloud/functions-emulator');
return controller.start();
Expand Down

0 comments on commit b43ecca

Please sign in to comment.