on master help sign in
Fix the build issue people were having. Sorry ngunn :( I couldn't stop thinking about it!
794b7f2evancz
compiler/Model/LoadLibraries.hs+15−6
@@ -1,13 +1,22 @@
1
1
2−module LoadLibraries where
2+module LoadLibraries (docs) where
3
3
4import Language.Haskell.TH.Syntax
4import Language.Haskell.TH.Syntax
5import Paths_Elm
5import Paths_Elm
6+import System.Directory
6
7
7docs :: Q Exp
8docs :: Q Exp
8−docs = liftString =<< qRunIO (do
9+docs = liftString =<< qRunIO readDocs
9− s <- readFile =<< getDataFileName "docs.json"
10− putStrLn s
11− return s
12− )
13
10
11+readDocs :: IO String
12+readDocs = do
13+ name <- getDataFileName "docs.json"
14+ exists <- doesFileExist name
15+ if exists then readFile name
16+ else putStrLn warning >> return "{\"modules\":[]}"
17+
18+warning = "Warning! Types for standard library not loaded properly!\n\
19+ \Run the following commands after compilation:\n\
20+ \\n\
21+ \ touch compiler/Model/LoadLibraries.hs\n\
22+ \ cabal install\n\n"