Merge pull request #7407 from fredericbonnet/master

Warn when backend plugin id has `-backend` suffix
This commit is contained in:
Fredrik Adelöw
2021-10-07 12:00:01 +02:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
When creating a backend plugin with `--backend` flag, don't add `-backend` if it's already suffixed
@@ -239,7 +239,10 @@ export default async (cmd: Command) => {
}
const answers: Answers = await inquirer.prompt(questions);
const pluginId = cmd.backend ? `${answers.id}-backend` : answers.id;
const pluginId =
cmd.backend && !answers.id.endsWith('-backend')
? `${answers.id}-backend`
: answers.id;
const name = cmd.scope
? `@${cmd.scope.replace(/^@/, '')}/plugin-${pluginId}`