diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index 241480e2..3f2efc4f 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -172,7 +172,7 @@ class Daemon { */ async cleanup () { if (!this.clean) { - await fs.rmdir(this.path, { + await fs.rm(this.path, { recursive: true }) this.clean = true diff --git a/src/utils.js b/src/utils.js index 0f08d799..af5c5108 100644 --- a/src/utils.js +++ b/src/utils.js @@ -14,7 +14,7 @@ const log = debug('ipfsd-ctl:utils') */ const removeRepo = async (repoPath) => { try { - await fs.promises.rmdir(repoPath, { + await fs.promises.rm(repoPath, { recursive: true }) } catch (err) {