From 377afbb3ccce56b553c3dfbab667e5d9e9cc96ce Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 11 Aug 2015 18:03:20 +0200 Subject: [PATCH] Turn extensions lowercase --- hashrename.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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