Skip to content

Commit 7ffffb6

Browse files
Fix authentication regression (#99)
1 parent 92ebee6 commit 7ffffb6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/interface/cli/Command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ class Command {
158158
return (yargs) => {
159159
b(yargs);
160160
_.forEach(this.subCommands, (subCommand) => {
161-
if (!subCommand.hasOwnProperty('requiresAuthentication') && command.hasOwnProperty('requiresAuthentication')) {
162-
subCommand.requiresAuthentication = command.requiresAuthentication;
161+
if (!subCommand.hasOwnProperty('requiresAuthentication') && this.hasOwnProperty('requiresAuthentication')) {
162+
subCommand.requiresAuthentication = this.requiresAuthentication;
163163
} else {
164164
subCommand.requiresAuthentication = true;
165165
}

lib/interface/cli/helpers/auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ const authManager = auth.manager;
55

66
const printTableForAuthContexts = () => {
77
const currentContext = authManager.getCurrentContext();
8+
if (!currentContext) {
9+
console.log('No authentication contexts.');
10+
return;
11+
}
812
const contexts = authManager.getAllContexts();
913
const keys = currentContext.defaultColumns;
1014
const res = [];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)