feat: migrate legacy database to new location and improve last login update handling

This commit is contained in:
simosmik
2026-02-23 22:12:00 +00:00
parent f986004319
commit 50e097d4ac
3 changed files with 26 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
// Load environment variables from .env before other imports execute.
import fs from 'fs';
import os from 'os';
import path from 'path';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
@@ -22,3 +23,7 @@ try {
} catch (e) {
console.log('No .env file found or error reading it:', e.message);
}
if (!process.env.DATABASE_PATH) {
process.env.DATABASE_PATH = path.join(os.homedir(), '.cloudcli', 'auth.db');
}