Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit a844110

Browse files
authored
Add rmdir', rm, rm' (#39)
* Add rmdir', rm, rm' * Bump node-fs version
1 parent a6acd33 commit a844110

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Breaking changes:
88

99
New features:
1010

11+
- Update rmdir' to take options arg
12+
- Added rm and rm' versions with and without options arg
13+
1114
Bugfixes:
1215

1316
Other improvements:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"dependencies": {
3030
"purescript-aff": "^7.0.0",
3131
"purescript-either": "^6.0.0",
32-
"purescript-node-fs": "^8.0.0",
32+
"purescript-node-fs": "^8.1.0",
3333
"purescript-node-path": "^5.0.0"
3434
},
3535
"devDependencies": {

src/Node/FS/Aff.purs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ module Node.FS.Aff
1111
, realpath'
1212
, unlink
1313
, rmdir
14+
, rmdir'
15+
, rm
16+
, rm'
1417
, mkdir
1518
, mkdir'
1619
, readdir
@@ -155,6 +158,25 @@ unlink = toAff1 A.unlink
155158
rmdir :: FilePath -> Aff Unit
156159
rmdir = toAff1 A.rmdir
157160

161+
-- |
162+
-- | Deletes a directory with options.
163+
-- |
164+
rmdir' :: FilePath -> { maxRetries :: Int, retryDelay :: Int } -> Aff Unit
165+
rmdir' = toAff2 A.rmdir'
166+
167+
168+
-- |
169+
-- | Deletes a file or directory.
170+
-- |
171+
rm :: FilePath -> Aff Unit
172+
rm = toAff1 A.rmdir
173+
174+
-- |
175+
-- | Deletes a file or directory with options.
176+
-- |
177+
rm' :: FilePath -> { force :: Boolean, maxRetries :: Int, recursive :: Boolean, retryDelay :: Int } -> Aff Unit
178+
rm' = toAff2 A.rm'
179+
158180
-- |
159181
-- | Makes a new directory.
160182
-- |

0 commit comments

Comments
 (0)