Skip to content

Commit b61f27b

Browse files
openapi spec returned (#297)
1 parent 183fc68 commit b61f27b

File tree

4 files changed

+7160
-13
lines changed

4 files changed

+7160
-13
lines changed

lib/interface/cli/helpers/general.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const CFError = require('cf-errors');
77
const path = require('path');
88
const Output = require('../../../output/Output');
99
const sdk = require('../../../logic/sdk');
10+
const openapi = require('../../../../openapi');
1011
const config = require('../../../logic/cli-config/Manager').config();
1112

1213
const isDebug = () => (process.env.DEBUG || '').includes(defaults.DEBUG_PATTERN);
@@ -18,21 +19,16 @@ const wrapHandler = (handler, requiresAuthentication) => {
1819
Output.init(argv);
1920
const authManager = require('../../../logic').auth.manager;
2021
const currentContext = authManager.getCurrentContext();
21-
if (requiresAuthentication) {
22-
if (!currentContext) {
23-
Output.printError(new CFError('Authentication error: Please create an authentication context (see codefresh auth create-context --help)'));
24-
process.exit(1);
25-
}
22+
if (requiresAuthentication && !currentContext) {
23+
Output.printError(new CFError('Authentication error: Please create an authentication context (see codefresh auth create-context --help)'));
24+
process.exit(1);
2625
}
2726

2827
if (process.env.NODE_ENV !== 'test') {
2928
const { url, token, type: contextType } = currentContext || {};
3029
const sdkConfig = {
3130
url,
32-
cache: {
33-
disableCache: !!(process.env.DISABLE_SDK_CACHE || process.argv.includes('--disable-cache')),
34-
forceRefresh: !!(process.env.FORCE_REFRESH_SDK_CACHE || process.argv.includes('--force-refresh-cache')),
35-
},
31+
spec: openapi,
3632
request: {
3733
...config.request,
3834
},

0 commit comments

Comments
 (0)