kopia lustrzana https://github.com/harvard-lil/archive.social
fix: create empty certs.json when it doesn't exist
rodzic
b260ca5726
commit
f55e5fc8d0
|
@ -50,8 +50,10 @@
|
|||
|
||||
const filepath = type === "signing" ? CertsHistory.signingFilepath : CertsHistory.timestampingFilepath;
|
||||
|
||||
if (!fs.readFileSync(filepath)) {
|
||||
fs.writeFileSync(filepath, "{}");
|
||||
try {
|
||||
fs.readFileSync(filepath)
|
||||
} catch (err) {
|
||||
fs.writeFileSync(filepath, "{}")
|
||||
}
|
||||
|
||||
return JSON.parse(fs.readFileSync(filepath));
|
||||
|
|
Ładowanie…
Reference in New Issue