From 7a8bad610472a0197f990dd5f28829f73fc0346e Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 13 Feb 2020 22:12:20 +0100 Subject: compiler: stabilise item order in index By sorting directory items alphabetically. GitHub: closes #119 --- compiler/src/Files.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler') 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 import Control.Monad (mapM) -import Data.List (isPrefixOf, length, subsequences) +import Data.List (isPrefixOf, length, subsequences, sortOn) import Data.Function ((&)) import Data.Text (pack) import Data.Aeson (ToJSON) @@ -154,6 +154,7 @@ readDirectory root = mkNode (Path []) >>= return . AnchoredFSNode root mkDirNode path canonicalPath = (listDirectory $ localPath (root /> path)) >>= mapM (mkNode . ((>= return . sortOn nodeName >>= return . Dir path canonicalPath copyTo :: FilePath -> AnchoredFSNode -> IO () -- cgit v1.2.3