Turn extensions lowercase

This commit is contained in:
rnhmjoj 2015-08-11 18:03:20 +02:00
parent 558c3a682a
commit 377afbb3cc

View File

@ -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