1515 */
1616
1717import { Flags , loglevel , orgApiVersionFlagWithDeprecations , SfCommand } from '@salesforce/sf-plugins-core' ;
18- import { Lifecycle , Messages , SfError , SfProject } from '@salesforce/core' ;
18+ import { Lifecycle , Messages , SfError } from '@salesforce/core' ;
1919import {
2020 INSTALL_URL_BASE ,
2121 Package ,
@@ -37,6 +37,7 @@ export class PackageConvert extends SfCommand<PackageVersionCreateRequestResult>
3737 public static readonly examples = messages . getMessages ( 'examples' ) ;
3838 public static readonly deprecateAliases = true ;
3939 public static readonly aliases = [ 'force:package:convert' ] ;
40+ public static readonly requiresProject = true ;
4041 public static readonly flags = {
4142 loglevel,
4243 'target-dev-hub' : requiredHubFlag ,
@@ -128,13 +129,7 @@ export class PackageConvert extends SfCommand<PackageVersionCreateRequestResult>
128129 } else {
129130 this . spinner . start ( 'Converting Package' , 'Initializing' ) ;
130131 }
131- // initialize the project instance if in a project
132- let project : SfProject | undefined ;
133- try {
134- project = await SfProject . resolve ( ) ;
135- } catch ( err ) {
136- // ignore project is optional
137- }
132+
138133 const result = await Package . convert (
139134 flags . package ,
140135 flags [ 'target-dev-hub' ] . getConnection ( flags [ 'api-version' ] ) ,
@@ -148,7 +143,7 @@ export class PackageConvert extends SfCommand<PackageVersionCreateRequestResult>
148143 patchversion : flags [ 'patch-version' ] as string ,
149144 codecoverage : flags [ 'code-coverage' ] as boolean ,
150145 } ,
151- project
146+ this . project
152147 ) ;
153148
154149 switch ( result . Status ) {
0 commit comments