Major version update. Major bugfixes. Security vulnerabilites fixed

This commit is contained in:
2026-10-14 03:02:07 +01:00
parent 4e47bd8ce0
commit 7c095f6f16
112 changed files with 2479 additions and 1219 deletions
+8 -5
View File
@@ -1,7 +1,6 @@
import { Command } from "commander";
import init from "../functions/init";
import grabDBDir from "../utils/grab-db-dir";
import fs from "fs";
import replaceDbFile from "../utils/replace-db-file";
import chalk from "chalk";
import grabSortedBackups from "../utils/grab-sorted-backups";
import { select } from "@inquirer/prompts";
@@ -12,7 +11,7 @@ export default function () {
.description("Restore Database")
.action(async (opts) => {
console.log(`Restoring up database ...`);
const { config } = await init();
const config = global.CONFIG;
const { backup_dir, db_file_path } = grabDBDir({ config });
const backups = grabSortedBackups({ config });
if (!backups?.[0]) {
@@ -32,13 +31,17 @@ export default function () {
};
}),
});
fs.cpSync(path.join(backup_dir, selected_backup), db_file_path);
global.SQLITE_CLIENT.close();
replaceDbFile({
src: path.join(backup_dir, selected_backup),
db_file_path,
});
console.log(`${chalk.bold(chalk.green(`DB Restore Success!`))}`);
process.exit();
}
catch (error) {
console.error(`Backup Restore ERROR => ${error.message}`);
process.exit();
process.exit(1);
}
});
}