Skip to content

Commit

Permalink
fix: don't create STORE_DIR/logs if ZWAVEJS_LOGS_DIR is setted (#…
Browse files Browse the repository at this point in the history
…3439)

Co-authored-by: Daniel Lando <[email protected]>
  • Loading branch information
alexojegu and robertsLando authored Nov 27, 2023
1 parent 2cd1e77 commit 46773f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion api/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
5 changes: 1 addition & 4 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46773f7

Please sign in to comment.