]> git.r.bdr.sh - rbdr/blog/commitdiff
Ensures blog exists on syncs
authorRuben Beltran del Rio <redacted>
Fri, 9 Dec 2022 22:05:32 +0000 (23:05 +0100)
committerRuben Beltran del Rio <redacted>
Fri, 9 Dec 2022 22:05:32 +0000 (23:05 +0100)
lib/blog.js

index d2acbb48d2c11739b4cdf09bd50f915962200f9e..fd5adaf96a1dc367ab9008aa215831fad260fc05 100644 (file)
@@ -199,6 +199,7 @@ module.exports = class Blog {
    */
   async syncDown() {
     internals.debuglog('Pulling remote state');
+    await ensureDirectoryExists(this.postsDirectory);
     await Remote.syncDown(this.remoteConfig, this.blogDirectory)
     internals.debuglog('Pulled remote state');
   }
@@ -213,6 +214,7 @@ module.exports = class Blog {
    */
   async syncUp() {
     internals.debuglog('Pushing remote state');
+    await ensureDirectoryExists(this.postsDirectory);
     await Remote.syncUp(this.remoteConfig, this.blogDirectory)
     internals.debuglog('Pushed remote state');
   }