on master help sign in
changed js backend to look for includes also in getIdrisLibDir
commitb36b2fd53a0127b85aec5aa0de5caea991408aa6 authorRui Barreiro <rui.barreiro@gmail.com> dateSun 11 Jun 2017, 09:44 (9 years ago) parentff75058
1 file changed+8−1
src/IRTS/JavaScript/Codegen.hs+8−1
src/IRTS/JavaScript/Codegen.hs+8−1
@@ -64,7 +64,14 @@ data CGConf = CGConf { header :: Text
6464
6565
6666getInclude :: 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
6875
6976getIncludes :: [FilePath] -> IO Text
7077getIncludes l = do