From 21c9dee6f856edf20d4f33f49f3f20d815be92d1 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 9 Jan 2022 18:50:30 -0600 Subject: [PATCH] Fix database path for Windows --- CHANGELOG.md | 3 +++ src/utils/create-database-url.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5af4bb2..e216935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ 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 +- The SQLite database path is now correctly generated on Windows + ### Changed - Track lookups no longer fail silently (error is returned and logged) diff --git a/src/utils/create-database-url.ts b/src/utils/create-database-url.ts index cab398e..becc973 100644 --- a/src/utils/create-database-url.ts +++ b/src/utils/create-database-url.ts @@ -1,4 +1,6 @@ -export const createDatabasePath = (directory: string) => `${directory}/db.sqlite`; +import {join} from 'path'; + +export const createDatabasePath = (directory: string) => join(directory, 'db.sqlite'); const createDatabaseUrl = (directory: string) => `file:${createDatabasePath(directory)}`;