From c8f6918b5516e75256a3b6f9ab60eb87d2c71a95 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Sun, 5 Apr 2015 12:59:08 -0700 Subject: [PATCH] --- hashrename.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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