This commit is contained in:
Zakary Timson 2022-03-09 19:28:09 +00:00
parent 72ea910c8d
commit 82e84b4c4e

View File

@ -143,25 +143,27 @@ export async function main(ns) {
if(err instanceof ArgError) return ns.tprint(argParser.help(err.message)); if(err instanceof ArgError) return ns.tprint(argParser.help(err.message));
throw err; throw err;
} }
// Banner if(!args['skip'] || args['skip'] != 32479805) {
ns.tprint('==================================================='); // Banner
ns.tprint(`Updating: ${args['device']}`); ns.tprint('===================================================');
ns.tprint('==================================================='); ns.tprint(`Updating: ${args['device']}`);
ns.tprint('===================================================');
}
// Run // Run
if(!args['skip']) { // Update self & restart if(!args['skip']) { // Update self & restart
await slowPrint(ns, 'Updating self:'); await slowPrint(ns, 'Updating self:');
await ns.wget(`${src}${updateFile}`, `${dest}${updateFile}`, args['target']); await ns.wget(`${src}${updateFile}`, `${dest}${updateFile}`, args['device']);
await downloadPrint(ns, `${dest}${updateFile}`); await downloadPrint(ns, `${dest}${updateFile}`);
ns.tprint(''); ns.tprint('');
await slowPrint(ns, 'Restarting...'); await slowPrint(ns, 'Restarting...');
ns.tprint(''); ns.tprint('');
return ns.exec(`${dest}${updateFile}`, args['target'], 1, 1); return ns.exec(`${dest}${updateFile}`, args['device'], 1, 32479805);
} else { // Update everything else } else { // Update everything else
await slowPrint(ns, 'Downloading scripts:'); await slowPrint(ns, 'Downloading scripts:');
for(let file of fileList) { for(let file of fileList) {
await ns.wget(`${src}${file}`, `${dest}${file}`, args['target']); await ns.wget(`${src}${file}`, `${dest}${file}`, args['device']);
await downloadPrint(ns, `${dest}${file}`); await downloadPrint(ns, `${dest}${file}`);
} }
ns.tprint(''); ns.tprint('');