Skip to content

Commit 1c5a315

Browse files
add_default_config (#162)
1 parent 17b7550 commit 1c5a315

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/interface/cli/codefresh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ recursive(path.resolve(__dirname, 'commands'), (err, files) => {
2929
})
3030
.config('cfconfig', 'Custom path for authentication contexts config file', (configFilePath) => {
3131
try {
32-
authManager.loadContexts(configFilePath, process.env.CF_API_KEY, process.env.CF_URL || DEFAULTS.URL);
32+
authManager.loadContexts(process.env.CF_API_KEY, process.env.CF_URL || DEFAULTS.URL , configFilePath);
3333
_.forEach(files, (file) => {
3434
if (file.endsWith('.cmd.js')) {
3535
const command = require(file);

lib/interface/functional/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function initialize(
1717
codefreshUrl = DEFAULTS.URL,
1818
codefreshApiKey = null,
1919
) {
20-
authManager.loadContexts(configFilePath, codefreshApiKey, codefreshUrl);
20+
authManager.loadContexts(codefreshApiKey, codefreshUrl, configFilePath);
2121
}
2222

2323
module.exports = {

lib/logic/auth/manager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require('fs');
22
const _ = require('lodash');
33
const CFError = require('cf-errors');
44
const yaml = require('js-yaml');
5+
const DEFAULTS = require('../../interface/cli/defaults');
56

67
// context classes
78
const { JWTContext, APIKeyContext } = require('./contexts');
@@ -72,7 +73,7 @@ class Manager {
7273
* @param configFilePath
7374
* @returns {{contexts: Array, "current-context": string}}
7475
*/
75-
loadContexts(configFilePath, cfToken, cfUrl) {
76+
loadContexts(cfToken, cfUrl, configFilePath = DEFAULTS.CFCONFIG) {
7677
this._setConfigFilePath(configFilePath);
7778

7879
try {

0 commit comments

Comments
 (0)