hedgequantx 1.2.118 → 1.2.120
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/package.json +1 -1
- package/src/app.js +7 -17
- package/src/pages/algo.js +1 -1
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -7,7 +7,7 @@ const chalk = require('chalk');
|
|
|
7
7
|
const inquirer = require('inquirer');
|
|
8
8
|
const ora = require('ora');
|
|
9
9
|
const figlet = require('figlet');
|
|
10
|
-
const { execSync } = require('child_process');
|
|
10
|
+
const { execSync, spawn } = require('child_process');
|
|
11
11
|
const path = require('path');
|
|
12
12
|
|
|
13
13
|
const { ProjectXService, connections } = require('./services');
|
|
@@ -691,32 +691,22 @@ const handleUpdate = async () => {
|
|
|
691
691
|
// Update via npm
|
|
692
692
|
spinner.text = `Updating v${currentVersion} -> v${latestVersion}...`;
|
|
693
693
|
try {
|
|
694
|
-
|
|
694
|
+
execSync('npm install -g hedgequantx@latest', { stdio: 'pipe' });
|
|
695
695
|
} catch (e) {
|
|
696
696
|
spinner.fail('Update failed - try manually: npm install -g hedgequantx@latest');
|
|
697
|
+
console.log(chalk.gray(` Error: ${e.message}`));
|
|
697
698
|
return;
|
|
698
699
|
}
|
|
699
700
|
|
|
700
701
|
spinner.succeed('CLI updated!');
|
|
701
702
|
console.log();
|
|
702
|
-
console.log(chalk.green(`
|
|
703
|
+
console.log(chalk.green(` Updated: v${currentVersion} -> v${latestVersion}`));
|
|
703
704
|
console.log();
|
|
704
|
-
console.log(chalk.cyan('
|
|
705
|
+
console.log(chalk.cyan(' Please restart HQX to apply changes.'));
|
|
705
706
|
console.log();
|
|
706
707
|
|
|
707
|
-
//
|
|
708
|
-
|
|
709
|
-
const child = spawn(process.argv[0], [path.join(cliPath, 'hedgequantx', 'bin', 'cli.js')], {
|
|
710
|
-
stdio: 'inherit',
|
|
711
|
-
shell: true
|
|
712
|
-
});
|
|
713
|
-
|
|
714
|
-
child.on('exit', (code) => {
|
|
715
|
-
process.exit(code);
|
|
716
|
-
});
|
|
717
|
-
|
|
718
|
-
// Stop current process loop
|
|
719
|
-
return 'restart';
|
|
708
|
+
// Exit so user can restart
|
|
709
|
+
process.exit(0);
|
|
720
710
|
|
|
721
711
|
} catch (error) {
|
|
722
712
|
spinner.fail('Update failed: ' + error.message);
|
package/src/pages/algo.js
CHANGED