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

Add rmdir', rm, rm' #39

Merged
merged 3 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Breaking changes:

New features:

- Update rmdir' to take options arg
- Added rm and rm' versions with and without options arg

Bugfixes:

Other improvements:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"purescript-aff": "^7.0.0",
"purescript-either": "^6.0.0",
"purescript-node-fs": "^8.0.0",
"purescript-node-fs": "^8.1.0",
"purescript-node-path": "^5.0.0"
},
"devDependencies": {
Expand Down
22 changes: 22 additions & 0 deletions src/Node/FS/Aff.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ module Node.FS.Aff
, realpath'
, unlink
, rmdir
, rmdir'
, rm
, rm'
, mkdir
, mkdir'
, readdir
Expand Down Expand Up @@ -155,6 +158,25 @@ unlink = toAff1 A.unlink
rmdir :: FilePath -> Aff Unit
rmdir = toAff1 A.rmdir

-- |
-- | Deletes a directory with options.
-- |
rmdir' :: FilePath -> { maxRetries :: Int, retryDelay :: Int } -> Aff Unit
rmdir' = toAff2 A.rmdir'


-- |
-- | Deletes a file or directory.
-- |
rm :: FilePath -> Aff Unit
rm = toAff1 A.rmdir

-- |
-- | Deletes a file or directory with options.
-- |
rm' :: FilePath -> { force :: Boolean, maxRetries :: Int, recursive :: Boolean, retryDelay :: Int } -> Aff Unit
rm' = toAff2 A.rm'

-- |
-- | Makes a new directory.
-- |
Expand Down