mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Replaced __dirname usage.
This commit is contained in:
parent
b5efbbbb2e
commit
73b45a9f5e
11 changed files with 25 additions and 28 deletions
|
|
@ -2,11 +2,8 @@
|
|||
import 'dotenv/config';
|
||||
import fse from 'fs-extra';
|
||||
import path from 'node:path';
|
||||
import url from 'node:url';
|
||||
import del from 'del';
|
||||
|
||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
||||
|
||||
function getDatabaseType(url = process.env.DATABASE_URL) {
|
||||
const type = process.env.DATABASE_TYPE || (url && url.split(':')[0]);
|
||||
|
||||
|
|
@ -25,8 +22,8 @@ if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
|
|||
|
||||
console.log(`Database type detected: ${databaseType}`);
|
||||
|
||||
const src = path.resolve(__dirname, `../db/${databaseType}`);
|
||||
const dest = path.resolve(__dirname, '../prisma');
|
||||
const src = path.resolve(process.cwd(), `db/${databaseType}`);
|
||||
const dest = path.resolve(process.cwd(), 'prisma');
|
||||
|
||||
del.sync(dest);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue