@quantum-hub/qhubctl 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,8 +29,7 @@ export default class SetContext extends AuthenticatedCommand {
29
29
  }
30
30
  async run() {
31
31
  const { args } = await this.parse(SetContext);
32
- const { contextId } = args;
33
- let selectedContext;
32
+ let { contextId } = args;
34
33
  if (!contextId) {
35
34
  ux.action.start('Loading available contexts');
36
35
  }
@@ -38,17 +37,15 @@ export default class SetContext extends AuthenticatedCommand {
38
37
  if (!contextId) {
39
38
  ux.action.stop('Done');
40
39
  }
41
- if (contextId) {
42
- selectedContext = accounts.find(account => account.id === contextId);
43
- }
44
- else {
40
+ if (!contextId) {
45
41
  const response = await select({
46
42
  choices: this.getPromptOptions(accounts),
47
43
  message: 'Choose a context',
48
44
  default: accounts[0],
49
45
  });
50
- selectedContext = accounts.find(account => account.id === response.id);
46
+ contextId = response.id;
51
47
  }
48
+ const selectedContext = accounts.find(account => account.id === contextId);
52
49
  if (!selectedContext) {
53
50
  this.error(`Context with id "${contextId}" not found.`);
54
51
  }
@@ -90,6 +90,29 @@
90
90
  "index.js"
91
91
  ]
92
92
  },
93
+ "list-contexts": {
94
+ "aliases": [],
95
+ "args": {},
96
+ "description": "Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.",
97
+ "examples": [
98
+ "$ qhubctl list-contexts"
99
+ ],
100
+ "flags": {},
101
+ "hasDynamicHelp": false,
102
+ "hiddenAliases": [],
103
+ "id": "list-contexts",
104
+ "pluginAlias": "@quantum-hub/qhubctl",
105
+ "pluginName": "@quantum-hub/qhubctl",
106
+ "pluginType": "core",
107
+ "strict": true,
108
+ "isESM": true,
109
+ "relativePath": [
110
+ "dist",
111
+ "commands",
112
+ "list-contexts",
113
+ "index.js"
114
+ ]
115
+ },
93
116
  "init": {
94
117
  "aliases": [],
95
118
  "args": {},
@@ -171,29 +194,6 @@
171
194
  "index.js"
172
195
  ]
173
196
  },
174
- "list-contexts": {
175
- "aliases": [],
176
- "args": {},
177
- "description": "Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.",
178
- "examples": [
179
- "$ qhubctl list-contexts"
180
- ],
181
- "flags": {},
182
- "hasDynamicHelp": false,
183
- "hiddenAliases": [],
184
- "id": "list-contexts",
185
- "pluginAlias": "@quantum-hub/qhubctl",
186
- "pluginName": "@quantum-hub/qhubctl",
187
- "pluginType": "core",
188
- "strict": true,
189
- "isESM": true,
190
- "relativePath": [
191
- "dist",
192
- "commands",
193
- "list-contexts",
194
- "index.js"
195
- ]
196
- },
197
197
  "logout": {
198
198
  "aliases": [],
199
199
  "args": {},
@@ -448,34 +448,6 @@
448
448
  "index.js"
449
449
  ]
450
450
  },
451
- "set-context": {
452
- "aliases": [],
453
- "args": {
454
- "contextId": {
455
- "name": "contextId"
456
- }
457
- },
458
- "description": "Set the current context, i.e., the personal or organization account you are currently working with.",
459
- "examples": [
460
- "$ qhubctl set-context",
461
- "$ qhubctl set-context <context-id>"
462
- ],
463
- "flags": {},
464
- "hasDynamicHelp": false,
465
- "hiddenAliases": [],
466
- "id": "set-context",
467
- "pluginAlias": "@quantum-hub/qhubctl",
468
- "pluginName": "@quantum-hub/qhubctl",
469
- "pluginType": "core",
470
- "strict": true,
471
- "isESM": true,
472
- "relativePath": [
473
- "dist",
474
- "commands",
475
- "set-context",
476
- "index.js"
477
- ]
478
- },
479
451
  "up": {
480
452
  "aliases": [],
481
453
  "args": {},
@@ -524,7 +496,35 @@
524
496
  "up",
525
497
  "index.js"
526
498
  ]
499
+ },
500
+ "set-context": {
501
+ "aliases": [],
502
+ "args": {
503
+ "contextId": {
504
+ "name": "contextId"
505
+ }
506
+ },
507
+ "description": "Set the current context, i.e., the personal or organization account you are currently working with.",
508
+ "examples": [
509
+ "$ qhubctl set-context",
510
+ "$ qhubctl set-context <context-id>"
511
+ ],
512
+ "flags": {},
513
+ "hasDynamicHelp": false,
514
+ "hiddenAliases": [],
515
+ "id": "set-context",
516
+ "pluginAlias": "@quantum-hub/qhubctl",
517
+ "pluginName": "@quantum-hub/qhubctl",
518
+ "pluginType": "core",
519
+ "strict": true,
520
+ "isESM": true,
521
+ "relativePath": [
522
+ "dist",
523
+ "commands",
524
+ "set-context",
525
+ "index.js"
526
+ ]
527
527
  }
528
528
  },
529
- "version": "1.1.4"
529
+ "version": "1.1.5"
530
530
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantum-hub/qhubctl",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Quantum Hub CLI",
5
5
  "author": "Kipu Quantum GmbH",
6
6
  "contributors": [