Added Backstage version to info command

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2022-07-22 13:28:03 -05:00
parent 226adf3192
commit a539564c0d
2 changed files with 17 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Added Backstage version to output of `yarn backstage-clie info` command
+12
View File
@@ -26,10 +26,22 @@ export default async () => {
// eslint-disable-next-line no-restricted-syntax
const isLocal = require('fs').existsSync(paths.resolveOwn('./src'));
const backstageFile = paths.resolveTargetRoot('backstage.json');
let backstageJson = undefined;
if (require('fs').existsSync(backstageFile)) {
const buffer = await require('fs').readFile(backstageFile);
backstageJson = JSON.parse(buffer.toString());
}
console.log(`OS: ${os.type} ${os.release} - ${os.platform}/${os.arch}`);
console.log(`node: ${process.version}`);
console.log(`yarn: ${yarnVersion}`);
console.log(`cli: ${cliVersion} (${isLocal ? 'local' : 'installed'})`);
console.log(
`backstage: ${
backstageJson && backstageJson.version ? backstageJson.version : 'N/A'
}`,
);
console.log();
console.log('Dependencies:');
const lockfilePath = paths.resolveTargetRoot('yarn.lock');