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 6666 "options" : {
6767 "appId" : {
6868 "hasValue" : true
69+ },
70+ "packageVersion" : {
71+ "hasValue" : true
72+ },
73+ "packageId" : {
74+ "hasValue" : true
6975 }
7076 }
7177 },
Original file line number Diff line number Diff line change @@ -217,10 +217,9 @@ export const packageCommands = {
217217 options,
218218 } : {
219219 args : string [ ] ;
220- options : { appId ?: string } ;
220+ options : { appId ?: string , packageId ?: string , packageVersion ?: string } ;
221221 } ) => {
222- let packageId = args [ 0 ] ;
223- let { appId } = options ;
222+ let { appId, packageId, packageVersion } = options ;
224223
225224 if ( ! appId ) {
226225 const platform = await getPlatform ( ) ;
@@ -229,7 +228,14 @@ export const packageCommands = {
229228
230229 // If no packageId provided as argument, let user choose from list
231230 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+ }
233239 packageId = selectedPackage . id ;
234240 }
235241
You can’t perform that action at this time.
0 commit comments