xinyu-pro 0.22.3 → 0.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/settings/page.tsx +2 -1
- package/bin/cli.js +14 -0
- package/package.json +1 -1
- package/version.json +1 -1
package/app/settings/page.tsx
CHANGED
package/bin/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ const { join, resolve } = require('path');
|
|
|
5
5
|
const { createInterface } = require('readline');
|
|
6
6
|
const { execSync, spawn } = require('child_process');
|
|
7
7
|
const { homedir } = require('os');
|
|
8
|
+
const path = require('path');
|
|
8
9
|
|
|
9
10
|
const isWin = process.platform === 'win32';
|
|
10
11
|
const APP_DIR = __dirname.includes('node_modules') ? resolve(__dirname, '..') : process.cwd();
|
|
@@ -12,6 +13,7 @@ const XINYU_HOME = join(homedir(), '.xinyu-pro');
|
|
|
12
13
|
const RUN_DIR = XINYU_HOME;
|
|
13
14
|
|
|
14
15
|
const args = process.argv.slice(2);
|
|
16
|
+
const VERSION_FLAG = args.includes('--version');
|
|
15
17
|
const HELP_FLAG = args.includes('--help') || args.includes('-h');
|
|
16
18
|
const DEV_FLAG = args.includes('--dev');
|
|
17
19
|
const RESET_FLAG = args.includes('--reset');
|
|
@@ -44,6 +46,13 @@ function ask(question) {
|
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
48
|
|
|
49
|
+
function showVersion() {
|
|
50
|
+
const versionPath = path.join(APP_DIR, 'version.json');
|
|
51
|
+
const versionData = JSON.parse(readFileSync(versionPath, 'utf-8'));
|
|
52
|
+
console.log(`${versionData.name} ${versionData.version}`);
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
function showHelp() {
|
|
48
57
|
echo('');
|
|
49
58
|
echo(' ╔══════════════════════════════════════╗', 'bold');
|
|
@@ -244,6 +253,11 @@ async function main() {
|
|
|
244
253
|
echo(' ╚══════════════════════════════════════╝', 'bold');
|
|
245
254
|
echo('');
|
|
246
255
|
|
|
256
|
+
if (VERSION_FLAG) {
|
|
257
|
+
showVersion();
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
247
261
|
if (HELP_FLAG) {
|
|
248
262
|
showHelp();
|
|
249
263
|
return;
|
package/package.json
CHANGED
package/version.json
CHANGED