Updated update script

This commit is contained in:
Zakary Timson 2022-03-11 16:56:04 +00:00
parent 7044959324
commit 8f1ac22fa1
2 changed files with 12 additions and 6 deletions

View File

@ -184,7 +184,7 @@ Options:
```
### [update.js](./scripts/update.js)
**RAM:** 2.95 GB
**RAM:** 2.65 GB
Download the latest script updates from the repository using wget.
```
@ -194,13 +194,14 @@ Running script with 1 thread(s), pid 1 and args: ["--help"].
Download the latest script updates from the repository using wget.
Usage: run update.js [OPTIONS] [SKIP]
Usage: run update.js [OPTIONS] [DEVICE]
run update.js --help
SKIP Skip updating self (for debugging)
DEVICE Device to update, defaults to current machine
Options:
-d --device Device to update, defaults to current machine
--skip-self Skip updating self (for debugging & used internally)
--no-banner Hide the banner (Used internally)
-h --help Display this help message
```

View File

@ -136,7 +136,8 @@ export async function main(ns) {
'miner.js',
'network-graph.js',
'node-manager.js',
'rootkit.js'
'rootkit.js',
'vanguard.js'
];
let args;
try {
@ -160,7 +161,7 @@ export async function main(ns) {
await downloadPrint(ns, `${dest}${updateFile}`);
ns.tprint('');
await slowPrint(ns, 'Restarting...');
const pid = ns.exec(`${dest}${updateFile}`, args['device'], 1, '--skip-self', '--no-banner');
const pid = ns.run(`${dest}${updateFile}`, 1, args['device'], '--skip-self', '--no-banner');
if(pid == 0) ns.tprint('Failed');
else ns.tprint('Complete');
return await slowPrint(ns, '');
@ -175,3 +176,7 @@ export async function main(ns) {
ns.tprint('');
}
}
export function autocomplete(data) {
return [...data.servers];
}