sharkey/packages/backend/src/tools/refresh-question.ts
syuilo d071d18dd7
refactor: Use ESM (#8358)
* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
2022-02-27 11:07:39 +09:00

18 lines
386 B
TypeScript

import { initDb } from '@/db/postgre.js';
async function main(uri: string): Promise<any> {
await initDb();
const { updateQuestion } = await import('@/remote/activitypub/models/question');
return await updateQuestion(uri);
}
const args = process.argv.slice(2);
const uri = args[0];
main(uri).then(result => {
console.log(`Done: ${result}`);
}).catch(e => {
console.warn(e);
});