File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed
lib/interface/cli/commands/context Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ const command = new Command({
31
31
. option ( 'decrypt' , {
32
32
describe : 'Either to show decoded credentials or not' ,
33
33
} )
34
+ . option ( 'prepare' , {
35
+ describe : 'Activate tokens in case its invalid' ,
36
+ } )
34
37
. example ( 'codefresh get context NAME' , 'Get context NAME' )
35
38
. example ( 'codefresh get contexts' , 'Get all contexts' )
36
39
. example ( 'codefresh get context --decrypt' , 'Get all contexts with credentials decrypted' )
@@ -45,10 +48,15 @@ const command = new Command({
45
48
data . type = argv . type ;
46
49
}
47
50
data . decrypt = argv . decrypt || undefined ;
51
+ data . prepare = argv . prepare || undefined ;
48
52
49
53
let contexts = [ ] ;
50
54
if ( ! _ . isEmpty ( names ) ) {
51
- contexts = await Promise . map ( names , name => sdk . contexts . get ( { name, decrypt : data . decrypt } ) ) ;
55
+ if ( data . prepare ) {
56
+ contexts = await Promise . map ( names , name => sdk . contexts . prepare ( { name } ) ) ;
57
+ } else {
58
+ contexts = await Promise . map ( names , name => sdk . contexts . get ( { name, decrypt : data . decrypt } ) ) ;
59
+ }
52
60
} else {
53
61
contexts = await sdk . contexts . list ( data ) ;
54
62
}
Original file line number Diff line number Diff line change 2588
2588
"x-sdk-interface" : " contexts.get"
2589
2589
}
2590
2590
},
2591
+ "/contexts/{name}/prepare" : {
2592
+ "get" : {
2593
+ "responses" : {
2594
+ "200" : {
2595
+ "$ref" : " #/components/responses/Json"
2596
+ }
2597
+ },
2598
+ "tags" : [
2599
+ " contexts"
2600
+ ],
2601
+ "operationId" : " contexts-prepare" ,
2602
+ "parameters" : [
2603
+ {
2604
+ "in" : " path" ,
2605
+ "name" : " name" ,
2606
+ "schema" : {
2607
+ "type" : " string"
2608
+ },
2609
+ "required" : true ,
2610
+ "description" : " Name"
2611
+ }],
2612
+ "summary" : " Get" ,
2613
+ "x-sdk-interface" : " contexts.prepare"
2614
+ }
2615
+ },
2591
2616
"/environments" : {
2592
2617
"get" : {
2593
2618
"responses" : {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.34 .0" ,
3
+ "version" : " 0.35 .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