更新内容
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { getDatabasePath, migrateSavesToDatabase } from './db.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const PROJECT_ROOT = path.resolve(__dirname, '..');
|
||||
const SAVES_DIR = path.resolve(process.env.SAVES_DIR || path.join(PROJECT_ROOT, 'saves'));
|
||||
|
||||
try {
|
||||
const migrated = await migrateSavesToDatabase(SAVES_DIR);
|
||||
console.log(`Migrated ${migrated.length} save files into SQLite.`);
|
||||
console.log(`SQLite database: ${getDatabasePath()}`);
|
||||
} catch (error) {
|
||||
console.error('Failed to migrate saves into SQLite.', error);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user