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');
77const Output = require ( '../../../../output/Output' ) ;
88const { sdk } = require ( '../../../../logic' ) ;
99const StepType = require ( '../../../../logic/entities/StepType' ) ;
10+ const StepTypeVersion = require ( '../../../../logic/entities/StepTypeVersion' ) ;
1011
1112const getRoot = require ( '../root/get.cmd' ) ;
1213
@@ -58,6 +59,11 @@ const command = new Command({
5859 describe : 'Limit amount of returned results' ,
5960 default : DEFAULTS . GET_LIMIT_RESULTS ,
6061 } )
62+ . option ( 'versions' , {
63+ describe : 'Get only typed-step versions' ,
64+ default : false ,
65+ boolean : true ,
66+ } )
6167 . option ( 'page' , {
6268 describe : 'Paginated page' ,
6369 default : DEFAULTS . GET_PAGINATED_PAGE ,
@@ -73,8 +79,12 @@ const command = new Command({
7379 const stage = argv . stage ;
7480 const official = argv . official ;
7581 const tag = argv . tag ;
82+ const onlyVersions = argv . versions ;
7683
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 ) ) {
7888 const steps = [ ] ;
7989 for ( const id of ids ) {
8090 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 11{
22 "name" : " codefresh" ,
3- "version" : " 0.32.1 " ,
3+ "version" : " 0.33.0 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments