From 078590b32222ed1238f12deb6e1e090476e43845 Mon Sep 17 00:00:00 2001 From: Yuvaraja Balamurugan Date: Sun, 22 Aug 2021 23:27:52 +0530 Subject: [PATCH] Add info output for cli type Signed-off-by: Yuvaraja Balamurugan --- packages/cli/src/commands/info.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/info.ts b/packages/cli/src/commands/info.ts index 6c6f692b1f..1f74186a2a 100644 --- a/packages/cli/src/commands/info.ts +++ b/packages/cli/src/commands/info.ts @@ -19,6 +19,7 @@ import os from 'os'; import { runPlain } from '../lib/run'; import { paths } from '../lib/paths'; import { Lockfile } from '../lib/versioning'; +import path from 'path'; export default async () => { await new Promise(async () => { @@ -41,7 +42,18 @@ export default async () => { console.log(`yarn - ${yarnVersion}`); console.log(`npm - ${npmVersion}`); - // TODO - How to find whether the current repo is a clone or a fork or a create-app generated repo? + console.log('\n------------------\n'); + + console.log('Backstage CLI type :\n'); + // eslint-disable-next-line no-restricted-syntax + const isLocal = require('fs').existsSync( + path.resolve(__dirname, '../../src'), + ); + console.log( + isLocal + ? 'CLI is running in backstage repo' + : 'CLI is running as a dependency', + ); console.log('\n------------------\n');