mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-09 19:51:36 +02:00
Fix Prisma path on Windows? (#499)
This commit is contained in:
parent
1b2781fe6a
commit
76dd6dd027
2 changed files with 11 additions and 1 deletions
|
@ -2,6 +2,14 @@ import {join} from 'path';
|
|||
|
||||
export const createDatabasePath = (directory: string) => join(directory, 'db.sqlite');
|
||||
|
||||
const createDatabaseUrl = (directory: string) => `file:${createDatabasePath(directory)}`;
|
||||
const createDatabaseUrl = (directory: string) => {
|
||||
const url = `file:${createDatabasePath(directory)}`;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
return url.replaceAll(/\\/g, '\\\\');
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
|
||||
export default createDatabaseUrl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue