Add remove files program

This commit is contained in:
Isaac Shoebottom 2023-11-13 14:27:28 -04:00
parent 78d8153f8e
commit 62b1d6edfd

View File

@ -1,4 +1,4 @@
import { recursiveHackingRequired, recursiveScan } from "./utils"
import { recursiveHackingRequired, recursiveScan, removeFilesOnAllServers } from "./utils"
export async function main(ns: NS) {
switch (ns.args[0]) {
@ -8,6 +8,9 @@ export async function main(ns: NS) {
case "getHackingLevels":
getHackingLevels(ns)
break
case "removeFiles":
removeFilesOnAllServersFromArgs(ns)
break
default:
ns.tprint("Invalid program name")
break
@ -21,3 +24,9 @@ function getServers(ns: NS) {
function getHackingLevels(ns: NS) {
ns.tprint(recursiveHackingRequired(ns))
}
function removeFilesOnAllServersFromArgs(ns: NS) {
let args = ns.args.slice(1)
let files = args.map((file) => file.toString())
removeFilesOnAllServers(ns, files)
}