This commit is contained in:
Michele Guerini Rocco 2015-04-05 12:59:08 -07:00
parent 1d6f9672f6
commit c8f6918b55

View File

@ -21,8 +21,8 @@ hex bytes = B.unpack bytes >>= printf "%02X"
newName :: FilePath -> IO FilePath
newName path = do
hash <- take 10 <$> fileHash path
let (file, ext) = splitExtension path
(dir, base) = splitFileName file
let (file, ext) = splitExtension path
(dir, base) = splitFileName file
new = dir </> hash <.> ext
if null base
then return path