File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/commands/force/package/beta/version Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
BY_LABEL ,
13
13
getHasMetadataRemoved ,
14
14
getPackageIdFromAlias ,
15
+ getPackageVersionId ,
15
16
PackageSaveResult ,
16
17
PackageVersion ,
17
18
validateId ,
@@ -42,11 +43,16 @@ export class PackageVersionPromoteCommand extends SfdxCommand {
42
43
43
44
public async run ( ) : Promise < PackageSaveResult > {
44
45
const conn = this . hubOrg . getConnection ( ) ;
45
- const packageId = getPackageIdFromAlias ( this . flags . package , this . project ) ?? ( this . flags . package as string ) ;
46
+ let packageId = getPackageIdFromAlias ( this . flags . package , this . project ) ?? ( this . flags . package as string ) ;
46
47
47
48
// ID can be 04t or 05i at this point
48
49
validateId ( [ BY_LABEL . SUBSCRIBER_PACKAGE_VERSION_ID , BY_LABEL . PACKAGE_VERSION_ID ] , packageId ) ;
49
50
51
+ if ( packageId . startsWith ( '04t' ) ) {
52
+ // lookup the 05i ID for getHasMetadataRemoved below
53
+ packageId = await getPackageVersionId ( packageId , conn ) ;
54
+ }
55
+
50
56
if ( ! this . flags . json && ! this . flags . noprompt ) {
51
57
// Warn when a Managed package has removed metadata
52
58
if ( await getHasMetadataRemoved ( packageId , conn ) ) {
You can’t perform that action at this time.
0 commit comments