diff --git a/backend/jest.config.js b/backend/jest.config.js index d9e7065d4..0e4643c63 100644 --- a/backend/jest.config.js +++ b/backend/jest.config.js @@ -10,7 +10,6 @@ module.exports = { process.env.NODE_ENV === 'development' ? '/../database/entity/$1' : '/../database/build/entity/$1', - // This is hack to fix a problem with the library `ts-mysql-migrate` which does differentiate between its ts/js state '@dbTools/(.*)': process.env.NODE_ENV === 'development' ? '/../database/src/$1' diff --git a/database/migrations/0012-login_user_backups_unify_wordlist.ts b/database/migrations/0012-login_user_backups_unify_wordlist.ts index a59a8da7f..0c04693ec 100644 --- a/database/migrations/0012-login_user_backups_unify_wordlist.ts +++ b/database/migrations/0012-login_user_backups_unify_wordlist.ts @@ -5,19 +5,20 @@ * This also removes the trailing space */ import fs from 'fs' +import path from 'path' const TARGET_MNEMONIC_TYPE = 2 const PHRASE_WORD_COUNT = 24 const WORDS_MNEMONIC_0 = fs - .readFileSync('src/config/mnemonic.uncompressed_buffer18112.txt') + .readFileSync(path.resolve(__dirname, '../src/config/mnemonic.uncompressed_buffer18112.txt')) .toString() .split(',') const WORDS_MNEMONIC_1 = fs - .readFileSync('src/config/mnemonic.uncompressed_buffer18113.txt') + .readFileSync(path.resolve(__dirname, '../src/config/mnemonic.uncompressed_buffer18113.txt')) .toString() .split(',') const WORDS_MNEMONIC_2 = fs - .readFileSync('src/config/mnemonic.uncompressed_buffer13116.txt') + .readFileSync(path.resolve(__dirname, '../src/config/mnemonic.uncompressed_buffer13116.txt')) .toString() .split(',') const WORDS_MNEMONIC = [WORDS_MNEMONIC_0, WORDS_MNEMONIC_1, WORDS_MNEMONIC_2] diff --git a/database/package.json b/database/package.json index 964bb07c7..d3bda1bc4 100644 --- a/database/package.json +++ b/database/package.json @@ -8,7 +8,7 @@ "license": "MIT", "private": false, "scripts": { - "build": "tsc --build", + "build": "mkdir -p build/src/config/ && cp src/config/*.txt build/src/config/ && tsc --build", "clean": "tsc --build --clean", "up": "node build/src/index.js up", "down": "node build/src/index.js down",