From 00b3de6c66da6367a9d88faaba1c04721bc078a4 Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Mon, 10 May 2021 14:28:30 +0100 Subject: [PATCH] fix export command #76 --- lib/core.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/core.js b/lib/core.js index 2cd82bd..7c479a1 100644 --- a/lib/core.js +++ b/lib/core.js @@ -248,7 +248,12 @@ async function unsubscribePackageAnnoucements(packageAnnoucementsTopic) { } async function exportPackages(db) { - await ipfs.files.rm('/forage/export', { recursive: true }) + try{ + await ipfs.files.rm('/forage/export', { recursive: true }) + } catch { + // no existing export folder + } + await ipfs.files.mkdir('/forage/export', {parents: true}) var loadpkgs = new Promise((resolve, reject) => {