Skip to content

Commit 38fc84f

Browse files
author
Chris Raynor
committed
fixing logged out state error introduced with refactor
1 parent 3421aa1 commit 38fc84f

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

lib/auth.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var auth = {
4444
} else if (response.minCLI) {
4545
console.log(chalk.red('Outdated CLI Version') + ' - Please update to at ' +
4646
'least v' + response.minCLI + ' by running ' +
47-
'npm update -g firebase-tools'.cyan);
47+
chalk.cyan('npm update -g ' + require('./firebase').name));
4848
process.exit(1);
4949
} else {
5050
setTimeout(callback, 0, new Error('Invalid Access Token'));
@@ -131,7 +131,7 @@ var auth = {
131131
} else if (response.minCLI) {
132132
console.log(chalk.red('Outdated CLI Version') + ' - Please update to at least ' +
133133
'v' + response.minCLI + ' by running ' +
134-
'npm update -g firebase-tools'.cyan);
134+
chalk.cyan('npm update -g ' + require('./firebase').name));
135135
process.exit(1);
136136
} else {
137137
if (typeof(callback) === 'function') {
@@ -253,9 +253,6 @@ var auth = {
253253
return config;
254254
},
255255
listFirebases: function() {
256-
var auth = this;
257-
var config = this.getConfig();
258-
var email = typeof config.email === 'string' ? util.format('(%s)', config.email) : '';
259256
return _when.promise(function(resolve, reject, notify) {
260257
auth.requireLogin(function(err) {
261258
if (err) {
@@ -273,7 +270,7 @@ var auth = {
273270
firebases: firebases,
274271
showFirebases: function() {
275272
console.log(chalk.yellow('----------------------------------------------------'));
276-
console.log(chalk.yellow(util.format('Your Firebase Apps %s', email)));
273+
console.log(chalk.yellow(util.format('Your Firebase Apps %s', auth.email)));
277274
console.log(chalk.yellow('----------------------------------------------------'));
278275
console.log(firebases.join('\n'));
279276
console.log(chalk.yellow('----------------------------------------------------'));

lib/firebase.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
var auth = require('./auth'),
22
packageInfo = require('../package.json'),
3-
fs = require('fs'),
4-
util = require('util'),
5-
chalk = require('chalk'),
6-
_when = require('when');
3+
chalk = require('chalk');
74

85
module.exports = {
96
login: function() {
@@ -39,5 +36,6 @@ module.exports = {
3936
}
4037
});
4138
},
42-
version: packageInfo.version || 0
39+
version: packageInfo.version || 0,
40+
name: packageInfo.name || 'firebase-tools'
4341
};

0 commit comments

Comments
 (0)