diff options
Diffstat (limited to 'hs/src/Files.hs')
-rw-r--r-- | hs/src/Files.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hs/src/Files.hs b/hs/src/Files.hs index 20554c1..bddcad6 100644 --- a/hs/src/Files.hs +++ b/hs/src/Files.hs @@ -36,7 +36,7 @@ fmt st | isBlockDevice st = "block" | otherwise = "UNKNOWN" instance Show FileStatus where - show st = fmt st + show = fmt fileTree :: [FilePath] -> IO [(FileStatus, [FilePath])] fileTree base = do @@ -58,8 +58,9 @@ isFiletype extension st path copyFile' :: FilePath -> FileStatus -> [FilePath] -> IO () copyFile' dest st path - | isDirectory st = createDirectoryIfMissing True (dest </> (joinPath $ tail path)) - | otherwise = copyFile (joinPath path) $ dest </> (joinPath $ tail path) + | isDirectory st = createDirectoryIfMissing True p + | otherwise = copyFile (joinPath path) p + where p = dest </> joinPath (tail path) copyFiles :: FilePath -> [(FileStatus, [FilePath])] -> IO () copyFiles dest = mapM_ (uncurry $ copyFile' dest) |