Skip to content

Commit

Permalink
fix: we don't import individual messages anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed May 4, 2023
1 parent 32bd37a commit 4a92a2f
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,6 @@ export class FlagBuilder {
lines.splice(flagsEndIndex, 0, ...flagParts);
}

const messagesStartIndex = lines.findIndex((line) => line.includes('Messages.loadMessages('));
if (messagesStartIndex) {
const messagesEndIndex =
lines.slice(messagesStartIndex).findIndex((line) => line.endsWith(';')) + messagesStartIndex;

// if the indices are equal that means that the messages are on the same line
if (messagesEndIndex === messagesStartIndex) {
const line = lines[messagesStartIndex];
const endIndex = line.indexOf(']');
const updated =
line.substring(0, endIndex) + `, 'flags.${this.answers.name}.summary'` + line.substring(endIndex);
lines[messagesStartIndex] = updated;
} else {
lines.splice(messagesEndIndex, 0, `'flags.${this.answers.name}.summary',`);
}
}

const sfPluginsCoreImport = lines.findIndex((line) => line.includes("from '@salesforce/sf-plugins-core'"));

const oclifCoreImport = lines.findIndex((line) => line.includes("from '@oclif/core'"));
Expand Down

0 comments on commit 4a92a2f

Please sign in to comment.