From 6ba326147e890e0efb9d8d5c722eaeb51ec05f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brauer?= Date: Mon, 6 Sep 2021 16:51:10 +0000 Subject: [PATCH] fix(info): test if logLocation is writable --- packages/info/logger/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/info/logger/index.js b/packages/info/logger/index.js index 2d9d25820..acc2cd3e2 100644 --- a/packages/info/logger/index.js +++ b/packages/info/logger/index.js @@ -20,7 +20,9 @@ class Logger { this.level = logLevels.info; this.logLocation = process.env.HOPS_LOG_LOCATION; - if (this.logLocation && !accessSync(this.logLocation, constants.W_OK)) { + try { + accessSync(this.logLocation, constants.W_OK); + } catch { this.logLocation = ''; }