24 lines
594 B
TypeScript
24 lines
594 B
TypeScript
import { app } from './common.ts';
|
|
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
|
|
const sentence = path.join(process.cwd(), 'data', 'sentence-01-optimized.json');
|
|
|
|
const data = JSON.parse(fs.readFileSync(sentence, 'utf-8'));
|
|
|
|
async function run() {
|
|
const sentences = data?.sentences || [];
|
|
console.log(`Importing ${sentences.length} sentences...`);
|
|
const res = await app.run({
|
|
path: 'image-creator',
|
|
// key: 'create-sentence-list',
|
|
key: 'fix-sentences',
|
|
payload: {
|
|
data: sentences
|
|
}
|
|
});
|
|
console.log('Import sentence result:', res);
|
|
}
|
|
|
|
await run(); |