mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 01:05:30 +01:00
Fix Prisma path on Windows? (#499)
This commit is contained in:
parent
1b2781fe6a
commit
76dd6dd027
|
@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- Prisma no longer causes a crash when running on Windows
|
||||
|
||||
## [0.5.3] - 2022-02-01
|
||||
### Changed
|
||||
|
|
|
@ -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…
Reference in a new issue