mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +01:00
commit
91f19d2d52
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -70,8 +70,6 @@ function convert(code: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function v1APIBreak(): void {
|
export function v1APIBreak(): void {
|
||||||
console.log("Running v1 api migration");
|
|
||||||
|
|
||||||
interface IFileLine {
|
interface IFileLine {
|
||||||
file: string;
|
file: string;
|
||||||
line: number;
|
line: number;
|
||||||
@ -109,7 +107,8 @@ export function v1APIBreak(): void {
|
|||||||
const backups: Script[] = [];
|
const backups: Script[] = [];
|
||||||
for (const script of server.scripts) {
|
for (const script of server.scripts) {
|
||||||
if (!hasChanges(script.code)) continue;
|
if (!hasChanges(script.code)) continue;
|
||||||
backups.push(new Script("BACKUP_" + script.filename, script.code, script.server));
|
const prefix = script.filename.includes("/") ? "/BACKUP_" : "BACKUP_";
|
||||||
|
backups.push(new Script(prefix + script.filename, script.code, script.server));
|
||||||
script.code = convert(script.code);
|
script.code = convert(script.code);
|
||||||
}
|
}
|
||||||
server.scripts = server.scripts.concat(backups);
|
server.scripts = server.scripts.concat(backups);
|
||||||
|
Loading…
Reference in New Issue
Block a user