19 lines
570 B
Haskell
19 lines
570 B
Haskell
|
|
module Main (main) where
|
||
|
|
|
||
|
|
import qualified Data.ByteString.Lazy as BL
|
||
|
|
import qualified Data.Text.IO as TIO
|
||
|
|
import Nuthatch.Http.Contract
|
||
|
|
( renderContractFixtures
|
||
|
|
, renderTypeScriptContract
|
||
|
|
)
|
||
|
|
import System.Environment (getArgs)
|
||
|
|
|
||
|
|
main :: IO ()
|
||
|
|
main = do
|
||
|
|
arguments <- getArgs
|
||
|
|
case arguments of
|
||
|
|
[contractOutput, fixtureOutput] -> do
|
||
|
|
TIO.writeFile contractOutput renderTypeScriptContract
|
||
|
|
BL.writeFile fixtureOutput renderContractFixtures
|
||
|
|
_ -> fail
|
||
|
|
"usage: nuthatch-generate-web-contract CONTRACT_OUTPUT FIXTURE_OUTPUT"
|