Skip to content

Commit

Permalink
fix #89 (for good this time, hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
CSchank committed Jul 6, 2019
1 parent f867898 commit cfe2454
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Generate/Helpers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ generateHelper l typeName netName (snTxt,edts) getOnly =
in
T.unlines
([
if l == Haskell then T.concat ["module ",netName,".Static.Helpers.",snTxt," where"]
if l == Haskell then T.concat ["module ",netName,".Static.Helpers.",typeName," where"]
else T.concat ["module ",netName,".Static.Helpers.",typeName,if getOnly then "Model" else ""," exposing (..)\nimport Dict exposing (Dict)"]
, if getOnly then
T.concat ["import Static.Types.",snTxt," exposing(Model(..))"]
T.concat ["import Static.Types.",snTxt," exposing(Model(..))"]
else ""
, if l == Elm then T.concat["import ",netName,".Static.ExtraTypes exposing(..)"] else ""
, T.concat ["import ",netName,".Static.Types",if not $ l == Haskell then " exposing(..)" else ""]
Expand Down
4 changes: 2 additions & 2 deletions src/Generate/Net/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ generate extraTypes fp net =
--create helpers
createDirectoryIfMissing True $ fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Helpers"
mapM_ (\(Place pName edts _ _ _) -> writeIfNew 0 (fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Helpers" </> T.unpack pName <.> "hs") $ T.unlines $ {-disclaimer currentTime :-} [generateHelper Haskell pName name (pName,edts) False]) places
mapM_ (\(Place pName _ pEdts _ _) -> writeIfNew 0 (fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Helpers" </> T.unpack pName ++ "Player" <.> "hs") $ T.unlines $ {-disclaimer currentTime :-} [generateHelper Haskell pName name (T.concat[pName, "Player"],pEdts) False]) places
mapM_ (\(CustomT cn constrs) -> writeIfNew 1 (fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Helpers" </> T.unpack cn <.> "hs") $ T.unlines [generateHelper Haskell cn name (head constrs) False]) singletonTypes
mapM_ (\(Place pName _ pEdts _ _) -> writeIfNew 0 (fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Helpers" </> T.unpack pName ++ "Player" <.> "hs") $ T.unlines $ {-disclaimer currentTime :-} [generateHelper Haskell (T.concat[pName,"Player"]) name (T.concat[pName, "Player"],pEdts) False]) places
mapM_ (\(CustomT cn constrs) -> writeIfNew 0 (fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Helpers" </> T.unpack cn <.> "hs") $ T.unlines [generateHelper Haskell cn name (head constrs) False]) singletonTypes

writeIfNew 0 (fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Encode" <.> "hs") encoder
writeIfNew 0 (fp </> "server" </> "src" </> T.unpack name </> "Static" </> "Decode" <.> "hs") decoder
Expand Down

0 comments on commit cfe2454

Please sign in to comment.