Skip to content

Commit 3666586

Browse files
committed
feat: add global --version to suite library that can be used to check install version
1 parent 65b121c commit 3666586

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.suite-cli/cli/cli.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ const ora = require('ora')
44
const { Command } = require('commander');
55
const { createPromptModule } = require('inquirer');
66
const { execSync } = require('node:child_process')
7-
const actionHandlers = require('./scripts')
8-
const { logInfo, getExistingComponent, getExistingApps, getNextAvailablePort, scaffoldApp, scaffoldGateways } = require('./scripts/scripts.module');
97
const { cwd } = require('node:process');
10-
const program = new Command()
11-
const prompt = createPromptModule()
8+
const { readFileSync } = require('node:fs');
9+
const path = require('node:path');
10+
const actionHandlers = require('./scripts')
11+
const { logInfo, getExistingComponent, getExistingApps, getNextAvailablePort, scaffoldApp, scaffoldGateways,readFileContent } = require('./scripts/scripts.module');
12+
13+
const program = new Command();
14+
const packageJsonPath = path.join(__dirname, 'package.json');
15+
const packageJSON = JSON.parse(readFileSync(packageJsonPath,{'encoding':'utf8'}));
16+
program.version(packageJSON.version); //get library version set by release script
17+
const prompt = createPromptModule();
1218
program
1319
.command('add')
1420
.description('Adds dependencies at given workspace and updates package.json')

.suite-cli/cli/scripts/scripts.module.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1736,5 +1736,6 @@ module.exports = {
17361736
test,
17371737
scaffoldApp,
17381738
scaffoldGateways,
1739-
getExistingApps
1739+
getExistingApps,
1740+
readFileContent
17401741
}

0 commit comments

Comments
 (0)