Skip to content

Commit 45ef5ca

Browse files
authored
fix: silence deprecation warning for fs.rmdir (#697)
`fs.rmdir` with the `recursive` option is deprecated in favour of `fs.rm` with the `recursive` operation, so use that instead.
1 parent 6b616e0 commit 45ef5ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ipfsd-daemon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Daemon {
172172
*/
173173
async cleanup () {
174174
if (!this.clean) {
175-
await fs.rmdir(this.path, {
175+
await fs.rm(this.path, {
176176
recursive: true
177177
})
178178
this.clean = true

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const log = debug('ipfsd-ctl:utils')
1414
*/
1515
const removeRepo = async (repoPath) => {
1616
try {
17-
await fs.promises.rmdir(repoPath, {
17+
await fs.promises.rm(repoPath, {
1818
recursive: true
1919
})
2020
} catch (err) {

0 commit comments

Comments
 (0)