From 9e249c86e7966e0bf1f86caa12308a4d0fc30d67 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Wed, 13 Apr 2022 21:24:08 +0100 Subject: [PATCH 1/3] Use underlying Sync.exists since Async.exists was removed --- src/Node/FS/Aff.purs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Node/FS/Aff.purs b/src/Node/FS/Aff.purs index 7d5e4f5..f77f3f4 100644 --- a/src/Node/FS/Aff.purs +++ b/src/Node/FS/Aff.purs @@ -32,16 +32,18 @@ module Node.FS.Aff import Prelude -import Effect.Aff (Aff, makeAff, nonCanceler) -import Effect (Effect) import Data.DateTime (DateTime) import Data.Maybe (Maybe) +import Effect (Effect) +import Effect.Aff (Aff, makeAff, nonCanceler) +import Effect.Class (liftEffect) import Node.Buffer (Buffer) import Node.Encoding (Encoding) import Node.FS as F import Node.FS.Async as A import Node.FS.Perms (Perms) import Node.FS.Stats (Stats) +import Node.FS.Sync as S import Node.Path (FilePath) toAff :: forall a. @@ -220,7 +222,7 @@ appendTextFile = toAff3 A.appendTextFile -- | Check to see if a file exists. -- | exists :: String -> Aff Boolean -exists file = makeAff \k -> A.exists file (pure >>> k) $> nonCanceler +exists = liftEffect <<< S.exists -- | Open a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback) -- | for details. From cd2650fe0f4bd034faaa5c4c4bbc9a5a68aacd6b Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Thu, 14 Apr 2022 10:37:25 +0100 Subject: [PATCH 2/3] Undoing what I undid --- CHANGELOG.md | 1 + src/Node/FS/Aff.purs | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97f17b4..7959ab4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: +- Remove `exists` since the underlying `Async.exists` from `purescript-node-fs` has been removed (#36 by @sigma-andex) - Update project and deps to PureScript v0.15.0 (#33 by @JordanMartinez, @thomashoneyman, @sigma-andex) - Update `mkdir'` to take options arg (#34 by @JordanMartinez) diff --git a/src/Node/FS/Aff.purs b/src/Node/FS/Aff.purs index f77f3f4..d879578 100644 --- a/src/Node/FS/Aff.purs +++ b/src/Node/FS/Aff.purs @@ -21,7 +21,6 @@ module Node.FS.Aff , writeTextFile , appendFile , appendTextFile - , exists , fdOpen , fdRead , fdNext @@ -218,11 +217,6 @@ appendFile = toAff2 A.appendFile appendTextFile :: Encoding -> FilePath -> String -> Aff Unit appendTextFile = toAff3 A.appendTextFile --- | --- | Check to see if a file exists. --- | -exists :: String -> Aff Boolean -exists = liftEffect <<< S.exists -- | Open a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback) -- | for details. From d538c9245c4c201b6ebb7eb1989e58fa79ad0049 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Thu, 14 Apr 2022 10:40:03 +0100 Subject: [PATCH 3/3] Organize imports --- src/Node/FS/Aff.purs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Node/FS/Aff.purs b/src/Node/FS/Aff.purs index d879578..ada916d 100644 --- a/src/Node/FS/Aff.purs +++ b/src/Node/FS/Aff.purs @@ -35,14 +35,12 @@ import Data.DateTime (DateTime) import Data.Maybe (Maybe) import Effect (Effect) import Effect.Aff (Aff, makeAff, nonCanceler) -import Effect.Class (liftEffect) import Node.Buffer (Buffer) import Node.Encoding (Encoding) import Node.FS as F import Node.FS.Async as A import Node.FS.Perms (Perms) import Node.FS.Stats (Stats) -import Node.FS.Sync as S import Node.Path (FilePath) toAff :: forall a.