Pass flag from command down to function

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2023-06-21 10:54:47 +02:00
parent 252297093b
commit 6adb6f4171
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Fixed the `--alwaysYarnPack` flag on the`backstage-cli build-workspace` command.
+6 -1
View File
@@ -17,12 +17,17 @@
import fs from 'fs-extra';
import { createDistWorkspace } from '../lib/packager';
export default async (dir: string, packages: string[]) => {
type Options = {
alwaysYarnPack?: boolean;
};
export default async (dir: string, packages: string[], options: Options) => {
if (!(await fs.pathExists(dir))) {
throw new Error(`Target workspace directory doesn't exist, '${dir}'`);
}
await createDistWorkspace(packages, {
targetDir: dir,
alwaysYarnPack: options.alwaysYarnPack,
});
};