fix: use import + re add sentry

This commit is contained in:
Saahil 2025-02-16 20:29:10 -05:00
parent 576ff5d0f7
commit 59d09432d3
No known key found for this signature in database
GPG key ID: 8A8B64515254CFC6
2 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,5 @@
import "dotenv/config";
// import "./modules/sentry";
import "./modules/sentry";
import * as Sentry from "@sentry/node";
import { Api } from "nocodb-sdk";
import init from "./modules/watch-git";

View file

@ -38,7 +38,8 @@ export default class CommandLoader {
for (const file of files) {
const stamp = Date.now();
try {
const commandClass = require(path.join(this.dir, file));
const commandClass = await import(path.join(this.dir, file));
console.log(commandClass)
cmds.push({ commandClass, file });
// const cmd = new commandClass.default();
// cmd.run(this._app);
@ -56,7 +57,7 @@ export default class CommandLoader {
}
for (const { commandClass, file } of cmds) {
const stamp = Date.now();
const c = new commandClass.default();
const c = commandClass.default ? new commandClass.default() : new commandClass();
console.log(`Running ${file}`);
try {
c.run(this._app);