From fcb1ed89274af8a625503f72067f3ce267068c21 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 May 2023 12:44:21 +1200 Subject: [PATCH] Only allow current user to read/write CLI prefs --- templates/cli/lib/config.js.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/cli/lib/config.js.twig b/templates/cli/lib/config.js.twig index 744013e38c..916865f441 100644 --- a/templates/cli/lib/config.js.twig +++ b/templates/cli/lib/config.js.twig @@ -15,7 +15,6 @@ class Config { const file = fs.readFileSync(this.path).toString(); this.data = JSONbig.parse(file); } catch (e) { - // console.log(`${this.path} not found. Empty data`); this.data = {}; } } @@ -25,7 +24,7 @@ class Config { if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }); } - fs.writeFileSync(this.path, JSONbig.stringify(this.data, null, 4)); + fs.writeFileSync(this.path, JSONbig.stringify(this.data, null, 4), { mode: 0o600 }); } get(key) {