Remove -backend suffix from backend plugin ids
Signed-off-by: Frédéric Bonnet <fredericbonnet@free.fr>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
When creating a backend plugin with `--backend` flag, warn when the given plugin id already ends with `-backend` suffix
|
||||
@@ -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}`
|
||||
|
||||
Reference in New Issue
Block a user