/[sudobot]/trunk/src/cli-commands/db/SyncDBCommand.ts
ViewVC logotype

Diff of /trunk/src/cli-commands/db/SyncDBCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 86 by rakin, Mon Jul 29 17:28:32 2024 UTC revision 104 by rakin, Mon Jul 29 17:28:36 2024 UTC
# Line 12  export default class SyncDBCommand exten Line 12  export default class SyncDBCommand exten
12      }      }
13    
14      async run(client: DiscordClient, argv: string[], args: string[]) {      async run(client: DiscordClient, argv: string[], args: string[]) {
15          const files = await readdir(path.join(client.rootdir, '/src/models'));          const files = await readdir(path.join(__dirname, '/../../models'));
16    
17          for await (const file of files) {          for await (const file of files) {
18              if (file === '..' || file === '.')              if (file === '..' || file === '.')
19                  continue;                  continue;
20                            
21              const { default: model } = await import(path.join(client.rootdir, '/src/models', file));              const { default: model } = await import(path.join(__dirname, '/../../models', file));
22              await model.sync({              await model.sync({
23                  logging: console.log                  logging: console.log
24              });              });

Legend:
Removed from v.86  
changed lines
  Added in v.104

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26