Major version update. Major bugfixes. Security vulnerabilites fixed
This commit is contained in:
+20
-2
@@ -4,14 +4,27 @@ import schema from "./schema";
|
||||
import typedef from "./typedef";
|
||||
import backup from "./backup";
|
||||
import restore from "./restore";
|
||||
import exportCmd from "./export";
|
||||
import importCmd from "./import";
|
||||
import admin from "./admin";
|
||||
import init from "../functions/init";
|
||||
import { readFileSync } from "fs";
|
||||
try {
|
||||
init();
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`Initialization ERROR => ${error.message}`);
|
||||
process.exit(1);
|
||||
}
|
||||
/** Resolves to the package root from both src/commands and dist/commands */
|
||||
const { version } = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf-8"));
|
||||
/**
|
||||
* # Describe Program
|
||||
*/
|
||||
program
|
||||
.name(`bun-sqlite`)
|
||||
.description(`SQLite manager for Bun`)
|
||||
.version(`1.0.0`);
|
||||
.version(version);
|
||||
/**
|
||||
* # Declare Commands
|
||||
*/
|
||||
@@ -19,6 +32,8 @@ program.addCommand(schema());
|
||||
program.addCommand(typedef());
|
||||
program.addCommand(backup());
|
||||
program.addCommand(restore());
|
||||
program.addCommand(exportCmd());
|
||||
program.addCommand(importCmd());
|
||||
program.addCommand(admin());
|
||||
/**
|
||||
* # Handle Unavailable Commands
|
||||
@@ -30,4 +45,7 @@ program.on("command:*", () => {
|
||||
/**
|
||||
* # Parse Arguments
|
||||
*/
|
||||
program.parse(Bun.argv);
|
||||
program.parseAsync(Bun.argv).catch((error) => {
|
||||
console.error(`ERROR => ${error?.message || error}`);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user