This commit is contained in:
rnhmjoj 2015-11-22 03:27:20 +01:00
parent 04d0742ff0
commit e16d17ed72
2 changed files with 6 additions and 5 deletions

View File

@ -8,8 +8,8 @@ import System.FilePath.Posix
import qualified Data.ByteString as B
getDirectoryFiles :: FilePath -> IO [FilePath]
getDirectoryFiles path =
map (path </>) <$> getDirectoryContents path >>= filterM doesFileExist
getDirectoryFiles path = map (path </>) <$>
getDirectoryContents path >>= filterM doesFileExist
fileHash :: FilePath -> IO String
fileHash = fmap (hex . hash) . B.readFile
@ -28,6 +28,7 @@ newName path = do
then return path
else return new
main :: IO ()
main = do
args <- getArgs
path <- case args of

View File

@ -1,5 +1,5 @@
name: hashrename
version: 0.1.0.0
version: 0.1.1.0
synopsis: Rename every file in a directory with his SHA1 hash. Perfect to clean messy folders.
license: MIT
license-file: LICENSE