Skip to content

feat: implement glob, cp, opendir and other methods #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
791cefe
feat: implement glob, cp, opendir and other methods
srghma-old Oct 4, 2024
86c67eb
feat: use FilePath instead of String where needed, AutodetectLink
srghma-old Oct 4, 2024
efebe33
feat: node-buffer-blob
srghma-old Oct 4, 2024
2e5f45c
feat: spago build --offline --censor-stats --strict --pedantic-packages
srghma-old Oct 4, 2024
ddd6a47
fix: tests
srghma-old Oct 5, 2024
e98b91c
rm -rdf .spago spago.lock output && spago upgrade --migrate && spago …
srghma-old Oct 5, 2024
2cc9b29
feat: opendirOptionsDefault
srghma-old Oct 5, 2024
13cf95d
refactor: tests -> move, use Test dir like specified in spago documen…
srghma-old Oct 6, 2024
e48eea5
feat: move Options to separate file
srghma-old Oct 6, 2024
4216697
feat: sync -> implement
srghma-old Oct 6, 2024
b226943
feat: aff -> forgot some functions
srghma-old Oct 6, 2024
1319b6b
fix: suggestions
srghma-old Oct 6, 2024
6f00cdf
feat: remove Node.FS.Sync.fdFlush
srghma-old Oct 6, 2024
602a6a8
fix: write
srghma-old Oct 6, 2024
9b146de
fix(#81): add copyFile_NO_FLAGS, make it default
srghma-old Oct 6, 2024
6575fd1
fix: --strict
srghma-old Oct 6, 2024
b0a8cca
fix: futimes, feat: add readlinkBuffer
srghma-old Oct 6, 2024
20f566a
feat: show for Dir, fix: show for Dirent
srghma-old Oct 8, 2024
43d512b
feat: reproduce TypeError [ERR_INVALID_ARG_TYPE]: The "options.filter…
srghma-old Oct 11, 2024
1df3ebd
fix: TypeError [ERR_INVALID_ARG_TYPE]: The "options.filter" property …
srghma-old Oct 11, 2024
84bba38
fix: cp options -> should be CopyMode
srghma-old Oct 11, 2024
50972ba
fix: cp -> split on cpFile and cpDir bc recursive is required for dirs
srghma-old Oct 11, 2024
3e2e675
feat: DirentType and getType -> add
srghma-old Oct 13, 2024
fcfddf9
feat: rename using sd -F 'DirentNameType' 'DirentName' $(fd --type file)
srghma-old Oct 13, 2024
bc7c327
feat: Dirent -> dont export isXXX
srghma-old Oct 13, 2024
4710e21
feat: move Callbacks
srghma-old Oct 13, 2024
111d26e
feat: Dir -> split
srghma-old Oct 13, 2024
3a1dc6f
refactor: tests -> wrong names
srghma-old Oct 13, 2024
4732d1b
refactor: Dir.Sync -> wrong names
srghma-old Oct 13, 2024
b9195f5
refactor: Dir -> explicit export
srghma-old Oct 13, 2024
622d56b
refactor: rename module
srghma-old Oct 13, 2024
0a1796a
feat: DirentType -> add derive
srghma-old Oct 13, 2024
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
Prev Previous commit
feat: DirentType -> add derive
  • Loading branch information
srghma-old committed Oct 13, 2024
commit 0a1796ac1c18a122b067a195dab9803f8789a438
8 changes: 8 additions & 0 deletions src/Node/FS/Dirent.purs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import Prelude
import Node.Buffer (Buffer)
import Node.Path (FilePath)
import Partial.Unsafe (unsafeCrashWith)
import Data.Generic.Rep (class Generic)
import Data.Show.Generic (genericShow)

data DirentName

Expand All @@ -40,6 +42,12 @@ data DirentType
| DirentType_Socket -- Dirent object describes a socket.
| DirentType_SymbolicLink -- Dirent object describes a symbolic link.

derive instance Eq DirentType
derive instance Ord DirentType
derive instance Generic DirentType _
instance Show DirentType where
show = genericShow

getType :: forall direntnametype. Dirent direntnametype -> DirentType
getType dirent =
if isBlockDevice dirent then DirentType_BlockDevice
Expand Down