hedgequantx 1.2.136 → 1.2.137
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/bin/cli.js +15 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -27,7 +27,8 @@ process.on('unhandledRejection', (err) => {
|
|
|
27
27
|
program
|
|
28
28
|
.name('hedgequantx')
|
|
29
29
|
.description('Prop Futures Algo Trading CLI')
|
|
30
|
-
.version(pkg.version)
|
|
30
|
+
.version(pkg.version)
|
|
31
|
+
.option('-u, --update', 'Update HQX to latest version');
|
|
31
32
|
|
|
32
33
|
program
|
|
33
34
|
.command('start', { isDefault: true })
|
|
@@ -44,5 +45,18 @@ program
|
|
|
44
45
|
console.log(`HedgeQuantX CLI v${pkg.version}`);
|
|
45
46
|
});
|
|
46
47
|
|
|
48
|
+
// Handle -u flag before parsing commands
|
|
49
|
+
if (process.argv.includes('-u') || process.argv.includes('--update')) {
|
|
50
|
+
const { execSync } = require('child_process');
|
|
51
|
+
console.log('Updating HedgeQuantX...');
|
|
52
|
+
try {
|
|
53
|
+
execSync('npm install -g hedgequantx@latest', { stdio: 'inherit' });
|
|
54
|
+
console.log('Update complete! Run "hqx" to start.');
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.error('Update failed:', e.message);
|
|
57
|
+
}
|
|
58
|
+
process.exit(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
47
61
|
// Parse and run
|
|
48
62
|
program.parse(process.argv);
|