Skip to content

Commit 92e05aa

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

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.suite-cli/cli/cli.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ 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()
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)
1117
const prompt = createPromptModule()
1218
program
1319
.command('add')

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

+2-1
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)