@@ -80,11 +80,12 @@ generateCode opts baseOutpath jsonFile = do
8080 dirparts = splitDirectories $ filepath
8181 mname = (\c -> if c == '.' then '_' else c) <$> last dirparts
8282 basedir = joinPath $ init dirparts
83− possInterfaceFilename = basedir </> outdir </> mname </> interfaceFileName mname
84− exists <- doesFileExist possInterfaceFilename
83+ mname' = moduleNameToIL' $ T.pack mname
84+ possibleFileName = basedir </> outdir </> (T.unpack mname') </> implFileName mname'
85+ exists <- doesFileExist possibleFileName
8586 if exists
8687 then do
87− modTime <- getModificationTime possInterfaceFilename
88+ modTime <- getModificationTime possibleFileName
8889 when (modTime < jsonModTime) $
8990 transpile opts baseOutpath jsonFile
9091 else transpile opts baseOutpath jsonFile
@@ -93,15 +94,12 @@ transpile :: [String] -> FilePath -> FilePath -> IO ()
9394transpile opts baseOutpath jsonFile = do
9495 jsonText <- T.decodeUtf8 <$> B.readFile jsonFile
9596 let module' = jsonToModule $ parseJson jsonText
96− ((interface, foreigns, asts, implHeader, implFooter), _) <- runSupplyT 5 (moduleToIL module' Nothing)
97+ ((_, foreigns, asts, implHeader, implFooter), _) <- runSupplyT 5 (moduleToIL module' Nothing)
9798 let mn = moduleNameToIL $ moduleName module'
9899 implementation = prettyPrintIL asts
99100 outpath = joinPath [baseOutpath, T.unpack mn]
100− interfacePath = outpath </> interfaceFileName (T.unpack mn)
101101 implPath = outpath </> implFileName mn
102− putStrLn interfacePath
103102 createDirectoryIfMissing True outpath
104− B.writeFile interfacePath $ T.encodeUtf8 interface
105103 putStrLn implPath
106104 B.writeFile implPath $ T.encodeUtf8 (implHeader <> implementation <> implFooter)
107105
@@ -116,9 +114,6 @@ writeRuntimeFiles baseOutpath = do
116114outdir :: FilePath
117115outdir = "src"
118116
119−interfaceFileName :: String -> FilePath
120−interfaceFileName mn = mn <> ".go"
121−
122117implFileName :: Text -> FilePath
123118implFileName mn = T.unpack $ mn <> ".go"
124119