pre-create and chmod 600 data file (#182)
This commit is contained in:
parent
f30d6f8027
commit
9216a8ead7
|
@ -22,6 +22,10 @@ export class LowdbStorageService implements StorageService {
|
||||||
NodeUtils.mkdirpSync(dir, '700');
|
NodeUtils.mkdirpSync(dir, '700');
|
||||||
}
|
}
|
||||||
this.dataFilePath = path.join(dir, 'data.json');
|
this.dataFilePath = path.join(dir, 'data.json');
|
||||||
|
if (!fs.existsSync(this.dataFilePath)) {
|
||||||
|
fs.writeFileSync(this.dataFilePath, '', { mode: 0o600 });
|
||||||
|
fs.chmodSync(this.dataFilePath, 0o600);
|
||||||
|
}
|
||||||
adapter = new FileSync(this.dataFilePath);
|
adapter = new FileSync(this.dataFilePath);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue