One more sort for #1684

This commit is contained in:
Michael Snoyman 2020-07-04 19:09:50 +03:00
parent 084a3cefb5
commit 7964967ba8
No known key found for this signature in database
GPG Key ID: 907EAE2F42B52046

View File

@ -71,7 +71,7 @@ import Data.FileEmbed (embedDir)
import Yesod.Core
import Yesod.Core.Types
import Data.List (intercalate)
import Data.List (intercalate, sort)
import Language.Haskell.TH
import Language.Haskell.TH.Syntax as TH
@ -192,7 +192,7 @@ getFileListPieces = flip evalStateT M.empty . flip go id
-> ([String] -> [String])
-> StateT (M.Map String String) IO [[String]]
go fp front = do
allContents <- liftIO $ filter notHidden `fmap` getDirectoryContents fp
allContents <- liftIO $ (sort . filter notHidden) `fmap` getDirectoryContents fp
let fullPath :: String -> String
fullPath f = fp ++ '/' : f
files <- liftIO $ filterM (doesFileExist . fullPath) allContents