hedgequantx 2.6.13 → 2.6.15
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/menus/dashboard.js +17 -15
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -219,23 +219,25 @@ const handleUpdate = async () => {
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
spinner.succeed(`UPDATED TO v${latestVersion}!`);
|
|
222
|
-
console.log(chalk.cyan(' RESTARTING HQX
|
|
222
|
+
console.log(chalk.cyan('\n RESTARTING HQX...\n'));
|
|
223
223
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const child = spawn('hqx', [], {
|
|
228
|
-
stdio: 'inherit',
|
|
229
|
-
detached: true,
|
|
230
|
-
shell: true
|
|
231
|
-
});
|
|
232
|
-
child.unref();
|
|
233
|
-
process.exit(0);
|
|
234
|
-
} catch (e) {
|
|
235
|
-
console.log(chalk.yellow('\n PLEASE RESTART HQX MANUALLY:'));
|
|
236
|
-
console.log(chalk.white(' hqx'));
|
|
237
|
-
await prompts.waitForEnter();
|
|
224
|
+
// Clean terminal state before restart
|
|
225
|
+
if (process.stdin.isTTY) {
|
|
226
|
+
process.stdin.setRawMode(false);
|
|
238
227
|
}
|
|
228
|
+
process.stdin.pause();
|
|
229
|
+
|
|
230
|
+
// Small delay then restart with clean stdio
|
|
231
|
+
await new Promise(r => setTimeout(r, 500));
|
|
232
|
+
|
|
233
|
+
// Use spawnSync to restart - replaces current process
|
|
234
|
+
const { spawnSync } = require('child_process');
|
|
235
|
+
spawnSync('hqx', [], {
|
|
236
|
+
stdio: 'inherit',
|
|
237
|
+
shell: true
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
process.exit(0);
|
|
239
241
|
|
|
240
242
|
} catch (error) {
|
|
241
243
|
if (spinner) spinner.fail('UPDATE ERROR');
|