Skip to content

Commit

Permalink
fix: directory not being created for blips file
Browse files Browse the repository at this point in the history
The directory was never created before attempting to create the blips file.
This causes the inital write of the file to fail.
  • Loading branch information
TGRHavoc committed Jul 11, 2019
1 parent db39357 commit 907c4ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/blips.js
Expand Up @@ -29,6 +29,7 @@ const BlipController = (SocketController) => {
}
} else {
try {
fs.mkdirSync(path.dirname(blipFile), {recursive: true});
fs.writeFileSync(blipFile, "{}");
} catch (err) {
log.warn("Error writing empty blip file... %s", err.message);
Expand All @@ -49,6 +50,7 @@ const BlipController = (SocketController) => {
// Make an empty blip file?
blips = {};
try {
fs.mkdirSync(bl);
fs.writeFileSync(blipFile, "{}");
} catch (err) {
log.warn("Error writing empty blip file... %s", err.message);
Expand Down

0 comments on commit 907c4ea

Please sign in to comment.