24 lines
596 B
TypeScript
24 lines
596 B
TypeScript
import { importCatalogExport } from '../src/entities/dashcam-catalog/api/importCatalogExport.ts';
|
|
|
|
const exportDir = process.env.DASHCAM_CATALOG_EXPORT_DIR ?? process.argv[2];
|
|
|
|
if (!exportDir) {
|
|
throw new Error('Set DASHCAM_CATALOG_EXPORT_DIR or pass the shared export directory as the first argument');
|
|
}
|
|
|
|
const result = await importCatalogExport({ exportDir });
|
|
|
|
console.log(
|
|
JSON.stringify(
|
|
{
|
|
status: 'imported',
|
|
exportId: result.exportId,
|
|
itemCount: result.itemCount,
|
|
sha256: result.sha256,
|
|
dbFilePath: result.dbFilePath,
|
|
},
|
|
null,
|
|
2,
|
|
),
|
|
);
|