Skip to content

Commit

Permalink
Add help command
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Long committed Sep 9, 2017
1 parent 01d6ff0 commit 277c0ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions commands/functions-shell.js
Expand Up @@ -52,6 +52,8 @@ module.exports = new Command('experimental:functions:shell')
}
});
replServer.context.config = emulator.config;
replServer.context.help = 'Instructions for the Functions Shell can be found at: ' +
'https://firebase.google.com/docs/functions/local-emulator';
}).then(function() {
return new RSVP.Promise(function(resolve) {
process.on('SIGINT', function() {
Expand Down
11 changes: 7 additions & 4 deletions lib/functionsEmulator.js
Expand Up @@ -122,9 +122,8 @@ FunctionsEmulator.prototype.start = function(shellMode) {
}).catch(function(e) {
utils.logWarning(chalk.yellow('functions:') + ' Failed to load functions source code. ' +
'Ensure that you have the latest SDK by running ' + chalk.bold('npm i --save firebase-functions') +
' inside the functions directory.' +
'Run ' + chalk.bold('firebase serve --only hosting') + ' to only serve hosting files.\n\n' + e);
return RSVP.resolve();
' inside the functions directory.');
return RSVP.reject(e);
}).then(function(triggers) {
instance.triggers = triggers;
var promises = _.map(triggers, function(trigger) {
Expand Down Expand Up @@ -179,7 +178,11 @@ FunctionsEmulator.prototype.start = function(shellMode) {
}));
}).then(function() {
var providerList = _.keys(emulatedProviders).sort().join(',');
track('Functions Emulation', providerList, emulatedFunctions.length);
if (emulatedFunctions.length > 0) {
track('Functions Emulation', providerList, emulatedFunctions.length);
} else {
return instance.stop();
}
}).catch(function(e) {
if (e) {
utils.logWarning(chalk.yellow('functions:') + ' Error from emulator. ' + e.stack);
Expand Down

0 comments on commit 277c0ad

Please sign in to comment.