Add remove files program
This commit is contained in:
parent
78d8153f8e
commit
62b1d6edfd
@ -1,4 +1,4 @@
|
|||||||
import { recursiveHackingRequired, recursiveScan } from "./utils"
|
import { recursiveHackingRequired, recursiveScan, removeFilesOnAllServers } from "./utils"
|
||||||
|
|
||||||
export async function main(ns: NS) {
|
export async function main(ns: NS) {
|
||||||
switch (ns.args[0]) {
|
switch (ns.args[0]) {
|
||||||
@ -8,6 +8,9 @@ export async function main(ns: NS) {
|
|||||||
case "getHackingLevels":
|
case "getHackingLevels":
|
||||||
getHackingLevels(ns)
|
getHackingLevels(ns)
|
||||||
break
|
break
|
||||||
|
case "removeFiles":
|
||||||
|
removeFilesOnAllServersFromArgs(ns)
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
ns.tprint("Invalid program name")
|
ns.tprint("Invalid program name")
|
||||||
break
|
break
|
||||||
@ -21,3 +24,9 @@ function getServers(ns: NS) {
|
|||||||
function getHackingLevels(ns: NS) {
|
function getHackingLevels(ns: NS) {
|
||||||
ns.tprint(recursiveHackingRequired(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)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user