Skip to content

Commit d4d2335

Browse files
authored
Merge pull request #106 from amtrack/feat/chunk-size-flag
feat: add --chunk-size flag (default: 10)
2 parents cc68aa8 + 6c655e2 commit d4d2335

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/commands/force/source/read.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export class SourceReadCommand extends SfCommand<any> {
3636
summary: `comma-separated list of source file paths to retrieve
3737
Example: 'force-app/main/default/objects/Account/recordTypes/Business.recordType-meta.xml,force-app/main/default/profiles/Admin.profile-meta.xml'`,
3838
}),
39+
"chunk-size": Flags.integer({
40+
summary: "number of components to be read per API call",
41+
description: "The limit for readMetadata() is 10. For CustomMetadata and CustomApplication only, the limit is 200.",
42+
max: 10,
43+
default: 10
44+
})
3945
};
4046

4147
public static readonly requiresProject = true;
@@ -64,7 +70,7 @@ export class SourceReadCommand extends SfCommand<any> {
6470
const chunkSize =
6571
typeName === "CustomApplication" || typeName === "CustomMetadata"
6672
? 200
67-
: 10;
73+
: flags["chunk-size"];
6874
for (const chunkOfMemberNames of chunk(typeMember.members, chunkSize)) {
6975
const componentNames = chunkOfMemberNames.map(
7076
(memberName) => `${typeName}:${memberName}`

0 commit comments

Comments
 (0)