Skip to content

Commit

Permalink
fix: don't duplicate examples
Browse files Browse the repository at this point in the history
  • Loading branch information
amphro committed Oct 27, 2020
1 parent d563047 commit cd6328b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ditamap/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ export class Command extends Ditamap {
trailblazerCommunityName = community.name;
}

if (Array.isArray(command.examples)) {
if (
help.includes('Examples:') &&
command.examples.map((foundAll, example) => foundAll && help.includes(example), true)
) {
// Examples are already in the help, so don't duplicate.
// This is legacy support for ToolbeltCommand in salesforce-alm.
delete command.examples;
}
}

const state = command.state || commandMeta.state;
this.data = Object.assign(command, {
binary: 'sfdx',
Expand Down

0 comments on commit cd6328b

Please sign in to comment.