add check file paths

This commit is contained in:
Henry 2023-07-29 02:01:18 +01:00
parent 6378e08f27
commit cec026a889
1 changed files with 5 additions and 1 deletions

View File

@ -356,9 +356,13 @@ export const getEnvironmentVariable = (name: string): string | undefined => {
const getEncryptionKeyFilePath = (): string => { const getEncryptionKeyFilePath = (): string => {
const checkPaths = [ const checkPaths = [
path.join(__dirname, '..', '..', 'encryption.key'), path.join(__dirname, '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', 'encryption.key'), path.join(__dirname, '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', 'encryption.key'), path.join(__dirname, '..', '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', '..', 'encryption.key') path.join(__dirname, '..', '..', '..', '..', 'server', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', '..', 'encryption.key'),
path.join(__dirname, '..', '..', '..', '..', '..', 'server', 'encryption.key')
] ]
for (const checkPath of checkPaths) { for (const checkPath of checkPaths) {
if (fs.existsSync(checkPath)) { if (fs.existsSync(checkPath)) {