Updated update script
This commit is contained in:
		@@ -1,18 +1,23 @@
 | 
				
			|||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Automatically download all the scripts in the repository.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
export async function main(ns) {
 | 
					export async function main(ns) {
 | 
				
			||||||
 | 
					    const SRC = 'https://gitlab.zakscode.com/ztimson/BitBurner/-/raw/develop/scripts/';
 | 
				
			||||||
 | 
					    const DIST = '/scripts/';
 | 
				
			||||||
    const FILE_LIST = [
 | 
					    const FILE_LIST = [
 | 
				
			||||||
        'scripts/auto-pwn.js',
 | 
					        'auto-pwn.js',
 | 
				
			||||||
        'scripts/bruteforce.js',
 | 
					        'bruteforce.js',
 | 
				
			||||||
        'scripts/crawler.js',
 | 
					        'crawler.js',
 | 
				
			||||||
        'scripts/miner.js',
 | 
					        'miner.js',
 | 
				
			||||||
        'scripts/node-manager.js',
 | 
					        'node-manager.js',
 | 
				
			||||||
        'scripts/update.js'
 | 
					        'update.js'
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function getUrl(file) {
 | 
					    // Download each file
 | 
				
			||||||
        return `https://gitlab.zakscode.com/ztimson/BitBurner/-/raw/develop/${file}`;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for(const FILE of FILE_LIST) {
 | 
					    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!');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user