kopia lustrzana https://github.com/harvard-lil/archive.social
Merge pull request #25 from dericko/main
fix: create empty certs.json when it doesn't existpull/26/head
commit
f2915d01ec
|
@ -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