aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2020-02-13 22:12:20 +0100
committerpacien2020-02-13 22:27:24 +0100
commit7a8bad610472a0197f990dd5f28829f73fc0346e (patch)
treea47e21b4a657e0b2f3ec96c3a482832f4a5fcedd
parent3503459d9c6e1f601702d79a560514dc44462277 (diff)
downloadldgallery-7a8bad610472a0197f990dd5f28829f73fc0346e.tar.gz
compiler: stabilise item order in index
By sorting directory items alphabetically. GitHub: closes #119
-rw-r--r--compiler/src/Files.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/src/Files.hs b/compiler/src/Files.hs
index 8ea943f..8a53b84 100644
--- a/compiler/src/Files.hs
+++ b/compiler/src/Files.hs
@@ -29,7 +29,7 @@ module Files
29 29
30 30
31import Control.Monad (mapM) 31import Control.Monad (mapM)
32import Data.List (isPrefixOf, length, subsequences) 32import Data.List (isPrefixOf, length, subsequences, sortOn)
33import Data.Function ((&)) 33import Data.Function ((&))
34import Data.Text (pack) 34import Data.Text (pack)
35import Data.Aeson (ToJSON) 35import Data.Aeson (ToJSON)
@@ -154,6 +154,7 @@ readDirectory root = mkNode (Path []) >>= return . AnchoredFSNode root
154 mkDirNode path canonicalPath = 154 mkDirNode path canonicalPath =
155 (listDirectory $ localPath (root /> path)) 155 (listDirectory $ localPath (root /> path))
156 >>= mapM (mkNode . ((</) path)) 156 >>= mapM (mkNode . ((</) path))
157 >>= return . sortOn nodeName
157 >>= return . Dir path canonicalPath 158 >>= return . Dir path canonicalPath
158 159
159copyTo :: FilePath -> AnchoredFSNode -> IO () 160copyTo :: FilePath -> AnchoredFSNode -> IO ()