File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
interface/cli/commands/step Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const { prepareKeyValueFromCLIEnvOption } = require('../../helpers/general');
7
7
const Output = require ( '../../../../output/Output' ) ;
8
8
const { sdk } = require ( '../../../../logic' ) ;
9
9
const StepType = require ( '../../../../logic/entities/StepType' ) ;
10
+ const StepTypeVersion = require ( '../../../../logic/entities/StepTypeVersion' ) ;
10
11
11
12
const getRoot = require ( '../root/get.cmd' ) ;
12
13
@@ -58,6 +59,11 @@ const command = new Command({
58
59
describe : 'Limit amount of returned results' ,
59
60
default : DEFAULTS . GET_LIMIT_RESULTS ,
60
61
} )
62
+ . option ( 'versions' , {
63
+ describe : 'Get only typed-step versions' ,
64
+ default : false ,
65
+ boolean : true ,
66
+ } )
61
67
. option ( 'page' , {
62
68
describe : 'Paginated page' ,
63
69
default : DEFAULTS . GET_PAGINATED_PAGE ,
@@ -73,8 +79,12 @@ const command = new Command({
73
79
const stage = argv . stage ;
74
80
const official = argv . official ;
75
81
const tag = argv . tag ;
82
+ const onlyVersions = argv . versions ;
76
83
77
- if ( ! _ . isEmpty ( ids ) ) {
84
+ if ( onlyVersions ) {
85
+ const res = await sdk . steps . getStepVersions ( { name : ids [ 0 ] } ) ;
86
+ Output . print ( _ . map ( res , StepTypeVersion . fromResponse ) ) ;
87
+ } else if ( ! _ . isEmpty ( ids ) ) {
78
88
const steps = [ ] ;
79
89
for ( const id of ids ) {
80
90
try {
Original file line number Diff line number Diff line change
1
+ const Entity = require ( './Entity' ) ;
2
+ const _ = require ( 'lodash' ) ;
3
+
4
+ class StepTypeVersion extends Entity {
5
+ constructor ( data ) {
6
+ super ( ) ;
7
+ this . entityType = 'step-type-version' ;
8
+ this . info = data ;
9
+ this . version = this . info ;
10
+ this . defaultColumns = [ 'version' ] ;
11
+ this . wideColumns = this . defaultColumns ;
12
+ }
13
+
14
+ static fromResponse ( response ) {
15
+ return new StepTypeVersion ( response ) ;
16
+ }
17
+ }
18
+
19
+ module . exports = StepTypeVersion ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.32.1 " ,
3
+ "version" : " 0.33.0 " ,
4
4
"description" : " Codefresh command line utility" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments