diff --git a/hashrename.hs b/hashrename.hs index 65e8da5..31e353c 100644 --- a/hashrename.hs +++ b/hashrename.hs @@ -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