Merge pull request #14500 from backstage/repo-build-pass-config

cli: allow passing --config option to repo build command
This commit is contained in:
Patrik Oldsberg
2022-11-08 13:33:39 +01:00
committed by GitHub
4 changed files with 13 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Allow passing `--config` option to `repo build` command
+1
View File
@@ -400,6 +400,7 @@ Commands:
Usage: backstage-cli repo build [options]
Options:
--config <path>
--all
--since <ref>
-h, --help
+1
View File
@@ -35,6 +35,7 @@ export function registerRepoCommand(program: Command) {
.description(
'Build packages in the project, excluding bundled app and backend packages.',
)
.option(...configOption)
.option(
'--all',
'Build all packages, including bundled app and backend packages.',
+6 -1
View File
@@ -152,9 +152,14 @@ export async function command(opts: OptionValues, cmd: Command): Promise<void> {
);
return;
}
const configPaths = opts.config?.length
? opts.config
: buildOptions.config ?? [];
await buildFrontend({
targetDir: pkg.dir,
configPaths: (buildOptions.config as string[]) ?? [],
configPaths,
writeStats: Boolean(buildOptions.stats),
});
},