From 8f85795c518258bce4dc845798bcea60bcb8e26a Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Fri, 4 Feb 2022 22:17:13 +0000 Subject: [PATCH] Updated update script --- scripts/update.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/scripts/update.js b/scripts/update.js index a235267..de6a1d5 100644 --- a/scripts/update.js +++ b/scripts/update.js @@ -1,18 +1,23 @@ +/** + * Automatically download all the scripts in the repository. + */ export async function main(ns) { + const SRC = 'https://gitlab.zakscode.com/ztimson/BitBurner/-/raw/develop/scripts/'; + const DIST = '/scripts/'; const FILE_LIST = [ - 'scripts/auto-pwn.js', - 'scripts/bruteforce.js', - 'scripts/crawler.js', - 'scripts/miner.js', - 'scripts/node-manager.js', - 'scripts/update.js' + 'auto-pwn.js', + 'bruteforce.js', + 'crawler.js', + 'miner.js', + 'node-manager.js', + 'update.js' ]; - function getUrl(file) { - return `https://gitlab.zakscode.com/ztimson/BitBurner/-/raw/develop/${file}`; - } - + // Download each file for(const FILE of FILE_LIST) { - await ns.wget(getUrl(FILE), FILE); + ns.tprint(`Downloading: ${FILE}...`); + await ns.wget(`${SRC}${FILE}`, `${DIST}${FILE}`); + ns.tprint('Complete!'); } + ns.tprint('Done!'); }