Skip to content

Commit 84bba38

Browse files
committed
fix: cp options -> should be CopyMode
1 parent 1df3ebd commit 84bba38

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Node/FS/Options.purs

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import Foreign (Foreign)
1010
import Foreign as Foreign
1111
import Node.Buffer (Buffer)
1212
import Node.Encoding (Encoding(..), encodingToNode)
13-
import Node.FS.Constants (FileFlags(..), fileFlagsToNode)
13+
import Node.FS.Constants (CopyMode, FileFlags(..), copyFile_NO_FLAGS, fileFlagsToNode)
1414
import Node.FS.Dirent (Dirent, DirentNameTypeString)
1515
import Node.FS.Internal.Undefinable (Undefinable)
1616
import Node.FS.Internal.Undefinable as Undefinable
1717
import Node.FS.Perms (Perms, all, mkPerms, permsToString, read, write)
18-
import Node.FS.Types (BufferLength, BufferOffset, EncodingString, FileMode, FilePosition)
18+
import Node.FS.Types (BufferLength, BufferOffset, EncodingString, FilePosition)
1919
import Node.Path (FilePath)
2020

2121
type RmdirOptions = { maxRetries :: Int, retryDelay :: Int }
@@ -254,7 +254,7 @@ type CpOptionsInternal =
254254
-- if null - will throw "TypeError [ERR_INVALID_ARG_TYPE]: The "options.filter" property must be of type function. Received null"
255255
, filter :: Undefinable (Fn2 FilePath FilePath Boolean)
256256
, force :: Boolean
257-
, mode :: FileMode
257+
, mode :: CopyMode
258258
, preserveTimestamps :: Boolean
259259
, recursive :: Boolean
260260
, verbatimSymlinks :: Boolean
@@ -266,7 +266,7 @@ type CpOptions =
266266
{ dereference :: Boolean -- Whether to dereference symlinks
267267
, filter :: Maybe (FilePath -> FilePath -> Boolean)
268268
, force :: CpForce
269-
, mode :: FileMode -- Modifiers for copy operation
269+
, mode :: CopyMode -- Modifiers for copy operation
270270
, preserveTimestamps :: Boolean -- Preserve timestamps from source
271271
, recursive :: Boolean -- Copy directories recursively
272272
, verbatimSymlinks :: Boolean -- Skip path resolution for symlinks
@@ -277,7 +277,7 @@ cpOptionsDefault =
277277
{ dereference: false
278278
, filter: Nothing
279279
, force: CpForce_TrueWithoutErrorOnExit
280-
, mode: 0
280+
, mode: copyFile_NO_FLAGS
281281
, preserveTimestamps: false
282282
, recursive: false
283283
, verbatimSymlinks: false

0 commit comments

Comments
 (0)