Merge pull request #1682 from danielyxie/dev

fix BACKUP/ folder
This commit is contained in:
hydroflame 2021-11-10 12:38:01 -05:00 committed by GitHub
commit 91f19d2d52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

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 {
console.log("Running v1 api migration");
interface IFileLine {
file: string;
line: number;
@ -109,7 +107,8 @@ export function v1APIBreak(): void {
const backups: Script[] = [];
for (const script of server.scripts) {
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);
}
server.scripts = server.scripts.concat(backups);