detect monorepo
This commit is contained in:
@@ -237,9 +237,11 @@ export default async (cmd: Command) => {
|
||||
const appPackage = paths.resolveTargetRoot('packages/app');
|
||||
const templateDir = paths.resolveOwn('templates/default-plugin');
|
||||
const tempDir = resolvePath(os.tmpdir(), answers.id);
|
||||
const pluginDir = (await fs.pathExists(paths.resolveTargetRoot('plugins')))
|
||||
const pluginDir = (await fs.pathExists(paths.resolveTargetRoot('lerna.json')))
|
||||
? paths.resolveTargetRoot('plugins', answers.id)
|
||||
: paths.resolveTargetRoot(answers.id);
|
||||
console.log(await paths.resolveTargetRoot('lerna.json'));
|
||||
console.log(await pluginDir);
|
||||
const ownerIds = parseOwnerIds(answers.owner);
|
||||
const version = backstageVersion;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ export async function templatingTask(
|
||||
throw new Error(`Failed to read template directory: ${error.message}`);
|
||||
});
|
||||
|
||||
const isMonoRepo = paths.resolveTargetRoot('lerna.json');
|
||||
const isMonoRepo = await fs.pathExists(paths.resolveTargetRoot('lerna.json'));
|
||||
|
||||
for (const file of files) {
|
||||
const destinationFile = file.replace(templateDir, destinationDir);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"test:all": "lerna run test -- --coverage",
|
||||
"lint": "lerna run lint --since origin/master --",
|
||||
"lint:all": "lerna run lint --",
|
||||
"create-plugin": "backstage-cli create-plugin",
|
||||
"create-plugin": "backstage-cli create-plugin --scope backstage --no-private",
|
||||
"remove-plugin": "backstage-cli remove-plugin"
|
||||
},
|
||||
"workspaces": {
|
||||
|
||||
Reference in New Issue
Block a user