diff --git a/hashrename.hs b/hashrename.hs index 57d39ea..fec4c41 100644 --- a/hashrename.hs +++ b/hashrename.hs @@ -1,4 +1,5 @@ import Control.Monad +import Data.Char (toLower) import Text.Printf (printf) import Crypto.Hash.SHA1 (hash) import System.Environment (getArgs) @@ -22,7 +23,7 @@ newName path = do hash <- take 10 <$> fileHash path let (file, ext) = splitExtension path (dir, base) = splitFileName file - new = dir hash <.> ext + new = dir hash <.> map toLower ext if null base then return path else return new