File tree 3 files changed +15
-5
lines changed
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,20 @@ type ByteCount = Int
50
50
--
51
51
data SymlinkType = FileLink | DirLink | JunctionLink
52
52
53
+ -- |
54
+ -- Convert a `SymlinkType` to a `String` expected by the Node.js filesystem
55
+ -- API.
56
+ --
57
+ symlinkTypeToNode :: SymlinkType -> String
58
+ symlinkTypeToNode ty = case ty of
59
+ FileLink -> " file"
60
+ DirLink -> " dir"
61
+ JunctionLink -> " junction"
62
+
53
63
instance showSymlinkType :: Show SymlinkType where
54
- show FileLink = " file "
55
- show DirLink = " dir "
56
- show JunctionLink = " junction "
64
+ show FileLink = " FileLink "
65
+ show DirLink = " DirLink "
66
+ show JunctionLink = " JunctionLink "
57
67
58
68
instance eqSymlinkType :: Eq SymlinkType where
59
69
eq FileLink FileLink = true
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ symlink :: forall eff. FilePath
167
167
-> Eff (fs :: FS | eff ) Unit
168
168
169
169
symlink src dest ty cb = mkEff $ \_ -> runFn4
170
- fs.symlink src dest (show ty) (handleCallback cb)
170
+ fs.symlink src dest (symlinkTypeToNode ty) (handleCallback cb)
171
171
172
172
-- |
173
173
-- Reads the value of a symlink.
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ symlink :: forall eff. FilePath
144
144
-> Eff (fs :: FS , err :: EXCEPTION | eff ) Unit
145
145
146
146
symlink src dst ty = mkEff $ \_ -> runFn3
147
- fs.symlinkSync src dst (show ty)
147
+ fs.symlinkSync src dst (symlinkTypeToNode ty)
148
148
149
149
-- |
150
150
-- Reads the value of a symlink.
You can’t perform that action at this time.
0 commit comments