let watcher self update

This commit is contained in:
Cyn 2021-12-23 14:59:01 -05:00
parent b7ae6c6464
commit 582f74ceb1

View File

@ -24,9 +24,13 @@ export async function main(ns : NS) : Promise<void> {
})
for(const process of processes) {
if(process.filename != ns.getScriptName()) {
ns.tprint(`INFO: Restarting ${process.filename} ${process.args} -t ${process.threads}`)
ns.kill(process.pid, ns.getHostname())
ns.run(process.filename, process.threads, ...process.args)
} else {
ns.spawn(process.filename, process.threads, ...process.args)
}
}
hashes[file] = hash