Skip to content

Commit cd6328b

Browse files
committed
fix: don't duplicate examples
1 parent d563047 commit cd6328b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ditamap/command.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ export class Command extends Ditamap {
4949
trailblazerCommunityName = community.name;
5050
}
5151

52+
if (Array.isArray(command.examples)) {
53+
if (
54+
help.includes('Examples:') &&
55+
command.examples.map((foundAll, example) => foundAll && help.includes(example), true)
56+
) {
57+
// Examples are already in the help, so don't duplicate.
58+
// This is legacy support for ToolbeltCommand in salesforce-alm.
59+
delete command.examples;
60+
}
61+
}
62+
5263
const state = command.state || commandMeta.state;
5364
this.data = Object.assign(command, {
5465
binary: 'sfdx',

0 commit comments

Comments
 (0)