detect monorepo

This commit is contained in:
Fabian Chong
2020-09-10 17:23:00 +08:00
parent 6b78834c09
commit 9cb2cfe2ee
3 changed files with 5 additions and 3 deletions
@@ -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;
+1 -1
View File
@@ -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": {