diff options
| author | Max Isom <[email protected]> | 2022-02-05 13:11:32 -0500 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2022-02-05 13:11:32 -0500 |
| commit | b9e21222f58882fda0abe2b56c94efd8e3044e91 (patch) | |
| tree | dcb88700a7bea1735708c8448c4a79573e29bda4 /src/utils | |
| parent | d1228eb6417a8256ec818398d830cf9e862ba9c3 (diff) | |
| parent | e883275d831f3d9bf3a57bd91e0deeeaf4951242 (diff) | |
| download | muse-b9e21222f58882fda0abe2b56c94efd8e3044e91.tar.xz muse-b9e21222f58882fda0abe2b56c94efd8e3044e91.zip | |
Merge branch 'master' into feature/slash-commands
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/create-database-url.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/utils/create-database-url.ts b/src/utils/create-database-url.ts index becc973..d17789b 100644 --- a/src/utils/create-database-url.ts +++ b/src/utils/create-database-url.ts @@ -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; |
