Skip to content

Commit b2889ed

Browse files
committed
fix: properly parse edition flag
1 parent 27a5a01 commit b2889ed

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2023, Salesforce.com, Inc.
1+
Copyright (c) 2024, Salesforce.com, Inc.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

src/commands/org/create/scratch.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
9-
108
import {
119
Messages,
1210
Lifecycle,
@@ -21,7 +19,7 @@ import { Duration } from '@salesforce/kit';
2119
import { buildScratchOrgRequest } from '../../../shared/scratchOrgRequest.js';
2220
import { buildStatus } from '../../../shared/scratchOrgOutput.js';
2321
import { ScratchCreateResponse } from '../../../shared/orgTypes.js';
24-
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
22+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
2523
const messages = Messages.loadMessages('@salesforce/plugin-org', 'create_scratch');
2624

2725
export const secretTimeout = 60000;
@@ -79,6 +77,15 @@ export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
7977
'partner-group',
8078
'partner-professional',
8179
],
80+
// eslint-disable-next-line @typescript-eslint/require-await
81+
parse: async (value: string) => {
82+
// the API expects partner editions in `partner <EDITION>` format.
83+
// so we replace the hyphen here with a space.
84+
if (value.startsWith('partner-')) {
85+
return value.replace('-', ' ');
86+
}
87+
return value;
88+
},
8289
helpGroup: definitionFileHelpGroupName,
8390
}),
8491
'no-namespace': Flags.boolean({

0 commit comments

Comments
 (0)