-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
|
||
module Main | ||
( main | ||
) where | ||
|
||
import Data.Proxy | ||
import DemoContract (DemoContract) | ||
import Options.Applicative | ||
import Plutus.PAB.Run.PSGenerator qualified as PSGenerator | ||
|
||
parseOptions :: IO FilePath | ||
parseOptions = customExecParser | ||
(prefs $ disambiguate <> showHelpOnEmpty <> showHelpOnError) | ||
(info (helper <*> psGenOutputDirParser) idm) | ||
|
||
psGenOutputDirParser :: Parser FilePath | ||
psGenOutputDirParser = option str | ||
(long "output-dir" <> | ||
metavar "OUTPUT_DIR" <> | ||
help "Output directory to write PureScript files to.") | ||
|
||
main :: IO () | ||
main = do | ||
psGenOutputDir <- parseOptions | ||
PSGenerator.generateAPIModule (Proxy :: Proxy DemoContract) psGenOutputDir | ||
PSGenerator.generateWith @DemoContract psGenOutputDir |