@@ -26,11 +26,6 @@ export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
26
26
public static readonly deprecateAliases = true ;
27
27
28
28
public static readonly flags = {
29
- 'target-org' : Flags . requiredOrg ( {
30
- summary : messages . getMessage ( 'flags.target-org.summary' ) ,
31
- required : true ,
32
- } ) ,
33
- 'api-version' : Flags . orgApiVersion ( ) ,
34
29
'job-id' : Flags . salesforceId ( {
35
30
char : 'i' ,
36
31
startsWith : '0Af' ,
@@ -63,14 +58,18 @@ export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
63
58
64
59
const deployOpts = cache . get ( jobId ) ;
65
60
const org = await Org . create ( { aliasOrUsername : deployOpts [ 'target-org' ] } ) ;
66
- const deployStatus = await org . getConnection ( flags [ 'api-version' ] ) . metadata . checkDeployStatus ( jobId , true ) ;
61
+ const [ deployStatus , componentSet ] = await Promise . all ( [
62
+ // we'll use whatever the org supports since we can't specify the org
63
+ // eslint-disable-next-line sf-plugin/get-connection-with-version
64
+ org . getConnection ( ) . metadata . checkDeployStatus ( jobId , true ) ,
65
+ buildComponentSet ( { ...deployOpts , wait : Duration . minutes ( deployOpts . wait ) } ) ,
66
+ ] ) ;
67
67
68
- const componentSet = await buildComponentSet ( { ...deployOpts , wait : Duration . minutes ( deployOpts . wait ) } ) ;
69
68
const result = new DeployResult ( deployStatus as MetadataApiDeployStatus , componentSet ) ;
70
69
71
70
const formatter = new DeployReportResultFormatter ( result , {
72
71
...deployOpts ,
73
- ...{ 'target-org' : flags [ 'target- org' ] } ,
72
+ ...{ 'target-org' : org } ,
74
73
} ) ;
75
74
76
75
if ( ! this . jsonEnabled ( ) ) formatter . display ( ) ;
0 commit comments