on master help sign in
changed js backend to look for includes also in getIdrisLibDir
b36b2fdRui Barreiro
src/IRTS/JavaScript/Codegen.hs+8−1
@@ -64,7 +64,14 @@ data CGConf = CGConf { header :: Text
64
64
65
65
66getInclude :: FilePath -> IO Text
66getInclude :: FilePath -> IO Text
67−getInclude p = TIO.readFile p
67+getInclude p =
68+ do
69+ libs <- getIdrisLibDir
70+ let libPath = libs </> p
71+ exitsInLib <- doesFileExist libPath
72+ if exitsInLib then
73+ TIO.readFile libPath
74+ else TIO.readFile p
68
75
69getIncludes :: [FilePath] -> IO Text
76getIncludes :: [FilePath] -> IO Text
70getIncludes l = do
77getIncludes l = do