diff --git a/packages/backend/src/tools/add-emoji.ts b/packages/backend/src/tools/add-emoji.ts deleted file mode 100644 index a3f4b54c7..000000000 --- a/packages/backend/src/tools/add-emoji.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { initDb } from '@/db/postgre'; -import { genId } from '@/misc/gen-id'; - -async function main(name: string, url: string, alias?: string): Promise { - await initDb(); - const { Emojis } = await import('@/models/index'); - - const aliases = alias != null ? [ alias ] : []; - - await Emojis.save({ - id: genId(), - host: null, - name, - url, - aliases, - updatedAt: new Date(), - }); -} - -const args = process.argv.slice(2); -const name = args[0]; -const url = args[1]; - -if (!name) throw new Error('require name'); -if (!url) throw new Error('require url'); - -main(name, url).then(() => { - console.log('success'); - process.exit(0); -}).catch(e => { - console.warn(e); - process.exit(1); -});