Skip to content

Commit fcb1ed8

Browse files
committed
Only allow current user to read/write CLI prefs
1 parent 0b967a6 commit fcb1ed8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

templates/cli/lib/config.js.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Config {
1515
const file = fs.readFileSync(this.path).toString();
1616
this.data = JSONbig.parse(file);
1717
} catch (e) {
18-
// console.log(`${this.path} not found. Empty data`);
1918
this.data = {};
2019
}
2120
}
@@ -25,7 +24,7 @@ class Config {
2524
if (!fs.existsSync(dir)) {
2625
fs.mkdirSync(dir, { recursive: true });
2726
}
28-
fs.writeFileSync(this.path, JSONbig.stringify(this.data, null, 4));
27+
fs.writeFileSync(this.path, JSONbig.stringify(this.data, null, 4), { mode: 0o600 });
2928
}
3029

3130
get(key) {

0 commit comments

Comments
 (0)