From b3ce300d32592a59f99deb33bc24867955955c17 Mon Sep 17 00:00:00 2001 From: mikiher Date: Wed, 4 Sep 2024 23:55:16 +0300 Subject: [PATCH] Fix some packaging and dependency issues --- package-lock.json | 1 + package.json | 7 +++++-- server/managers/MigrationManager.js | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4dd6d347..47798177 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "2.13.3", "license": "GPL-3.0", "dependencies": { + "@rushstack/terminal": "^0.14.0", "axios": "^0.27.2", "cookie-parser": "^1.4.6", "express": "^4.17.1", diff --git a/package.json b/package.json index c7f3b24c..745b7383 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,13 @@ "pkg": { "assets": [ "client/dist/**/*", - "node_modules/sqlite3/lib/binding/**/*.node" + "node_modules/sqlite3/lib/binding/**/*.node", + "node_modules/string-argv/commonjs/package.json" ], "scripts": [ "prod.js", - "server/**/*.js" + "server/**/*.js", + "node_modules/string-argv/commonjs/*.js" ] }, "mocha": { @@ -35,6 +37,7 @@ "author": "advplyr", "license": "GPL-3.0", "dependencies": { + "@rushstack/terminal": "^0.14.0", "axios": "^0.27.2", "cookie-parser": "^1.4.6", "express": "^4.17.1", diff --git a/server/managers/MigrationManager.js b/server/managers/MigrationManager.js index fa607764..2299327f 100644 --- a/server/managers/MigrationManager.js +++ b/server/managers/MigrationManager.js @@ -92,13 +92,13 @@ class MigrationManager { try { await this.copyMigrationsToConfigDir() } catch (error) { - throw new Error('Failed to copy migrations to the config directory.', error) + throw new Error('Failed to copy migrations to the config directory.', { cause: error }) } try { await this.updateMaxVersion(serverVersion) } catch (error) { - throw new Error('Failed to update max version in the database.', error) + throw new Error('Failed to update max version in the database.', { cause: error }) } } @@ -156,6 +156,8 @@ class MigrationManager { await fs.ensureDir(this.migrationsDir) // Ensure the target directory exists + if (!(await fs.pathExists(migrationsSourceDir))) return + const files = await fs.readdir(migrationsSourceDir) await Promise.all( files