From 8ad8e7a9fcc2d866f5684a3280262823b117e673 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Tue, 1 Feb 2022 18:21:27 -0500 Subject: [PATCH 1/4] Trim environment variables --- CHANGELOG.md | 2 ++ src/services/config.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b6c7eb..08ba887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] +### Changed +- Environment variable values are now trimmed (whitespace is removed) ## [0.5.2] - 2022-01-29 ### Fixed diff --git a/src/services/config.ts b/src/services/config.ts index e96e371..0720c2c 100644 --- a/src/services/config.ts +++ b/src/services/config.ts @@ -38,7 +38,7 @@ export default class Config { if (typeof value === 'number') { this[key as ConditionalKeys] = value; } else if (typeof value === 'string') { - this[key as ConditionalKeys] = value; + this[key as ConditionalKeys] = value.trim(); } else { throw new Error(`Unsupported type for ${key}`); } From 1b2781fe6ad0b089594f043aaea84f002451d712 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Tue, 1 Feb 2022 18:22:59 -0500 Subject: [PATCH 2/4] Release 0.5.3 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08ba887..b85c785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] + +## [0.5.3] - 2022-02-01 ### Changed - Environment variable values are now trimmed (whitespace is removed) @@ -56,7 +58,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[Unreleased]: https://github.com/codetheweb/muse/compare/v0.5.2...HEAD +[Unreleased]: https://github.com/codetheweb/muse/compare/v0.5.3...HEAD +[0.5.3]: https://github.com/codetheweb/muse/compare/v0.5.2...v0.5.3 [0.5.2]: https://github.com/codetheweb/muse/compare/v0.5.1...v0.5.2 [0.5.1]: https://github.com/codetheweb/muse/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/codetheweb/muse/compare/v0.4.0...v0.5.0 diff --git a/package.json b/package.json index 7782628..4cc4855 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "0.5.2", + "version": "0.5.3", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "exports": "./dist/src/index.js", "repository": "git@github.com:codetheweb/muse.git", From 76dd6dd02752cb1b09009c98c8993d2457ab280b Mon Sep 17 00:00:00 2001 From: Max Isom Date: Tue, 1 Feb 2022 19:54:30 -0600 Subject: [PATCH 3/4] Fix Prisma path on Windows? (#499) --- CHANGELOG.md | 2 ++ src/utils/create-database-url.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b85c785..50dd658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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; From e883275d831f3d9bf3a57bd91e0deeeaf4951242 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Tue, 1 Feb 2022 20:54:43 -0500 Subject: [PATCH 4/4] Release 0.5.4 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50dd658..3269aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] + +## [0.5.4] - 2022-02-01 ### Fixed - Prisma no longer causes a crash when running on Windows @@ -60,7 +62,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[Unreleased]: https://github.com/codetheweb/muse/compare/v0.5.3...HEAD +[Unreleased]: https://github.com/codetheweb/muse/compare/v0.5.4...HEAD +[0.5.4]: https://github.com/codetheweb/muse/compare/v0.5.3...v0.5.4 [0.5.3]: https://github.com/codetheweb/muse/compare/v0.5.2...v0.5.3 [0.5.2]: https://github.com/codetheweb/muse/compare/v0.5.1...v0.5.2 [0.5.1]: https://github.com/codetheweb/muse/compare/v0.5.0...v0.5.1 diff --git a/package.json b/package.json index 4cc4855..708be51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "0.5.3", + "version": "0.5.4", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "exports": "./dist/src/index.js", "repository": "git@github.com:codetheweb/muse.git",