File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 66
66
"options" : {
67
67
"appId" : {
68
68
"hasValue" : true
69
+ },
70
+ "packageVersion" : {
71
+ "hasValue" : true
72
+ },
73
+ "packageId" : {
74
+ "hasValue" : true
69
75
}
70
76
}
71
77
},
Original file line number Diff line number Diff line change @@ -217,10 +217,9 @@ export const packageCommands = {
217
217
options,
218
218
} : {
219
219
args : string [ ] ;
220
- options : { appId ?: string } ;
220
+ options : { appId ?: string , packageId ?: string , packageVersion ?: string } ;
221
221
} ) => {
222
- let packageId = args [ 0 ] ;
223
- let { appId } = options ;
222
+ let { appId, packageId, packageVersion } = options ;
224
223
225
224
if ( ! appId ) {
226
225
const platform = await getPlatform ( ) ;
@@ -229,7 +228,14 @@ export const packageCommands = {
229
228
230
229
// If no packageId provided as argument, let user choose from list
231
230
if ( ! packageId ) {
232
- const selectedPackage = await choosePackage ( appId ) ;
231
+ const allPkgs = await getAllPackages ( appId ) ;
232
+ if ( ! allPkgs ) {
233
+ throw new Error ( t ( 'noPackagesFound' , { appId } ) ) ;
234
+ }
235
+ const selectedPackage = allPkgs . find ( ( pkg ) => pkg . version === packageVersion ) ;
236
+ if ( ! selectedPackage ) {
237
+ throw new Error ( t ( 'packageNotFound' , { packageVersion } ) ) ;
238
+ }
233
239
packageId = selectedPackage . id ;
234
240
}
235
241
You can’t perform that action at this time.
0 commit comments