From 46773f7c5a1447b490fe902657139f46b17761ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Ojeda=20Guti=C3=A9rrez?= <63747287+alexojegu@users.noreply.github.com> Date: Mon, 27 Nov 2023 13:36:29 +0100 Subject: [PATCH] fix: don't create `STORE_DIR/logs` if `ZWAVEJS_LOGS_DIR` is setted (#3439) Co-authored-by: Daniel Lando --- api/config/app.ts | 3 ++- api/lib/ZwaveClient.ts | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api/config/app.ts b/api/config/app.ts index 8bc71f73eb..30727220c3 100644 --- a/api/config/app.ts +++ b/api/config/app.ts @@ -6,7 +6,8 @@ config({ path: './.env.app' }) // config/app.js export const title: string = 'Z-Wave JS UI' export const storeDir: string = process.env.STORE_DIR || joinPath(true, 'store') -export const logsDir: string = joinPath(storeDir, 'logs') +export const logsDir: string = + process.env.ZWAVEJS_LOGS_DIR || joinPath(storeDir, 'logs') export const snippetsDir: string = joinPath(storeDir, 'snippets') export const tmpDir: string = joinPath(storeDir, '.tmp') diff --git a/api/lib/ZwaveClient.ts b/api/lib/ZwaveClient.ts index 9a41331f34..493a99994c 100644 --- a/api/lib/ZwaveClient.ts +++ b/api/lib/ZwaveClient.ts @@ -305,10 +305,7 @@ export type SensorTypeScale = { export type AllowedApis = (typeof allowedApis)[number] -const ZWAVEJS_LOG_FILE = utils.joinPath( - process.env.ZWAVEJS_LOGS_DIR || logsDir, - 'zwavejs_%DATE%.log', -) +const ZWAVEJS_LOG_FILE = utils.joinPath(logsDir, 'zwavejs_%DATE%.log') export type ZUIValueIdState = { text: string