2021-04-16 13:43:57 +03:00
|
|
|
module Cli.Common
|
2021-04-28 18:36:00 +03:00
|
|
|
( WaspProjectDir,
|
|
|
|
DotWaspDir,
|
|
|
|
CliTemplatesDir,
|
|
|
|
dotWaspDirInWaspProjectDir,
|
|
|
|
dotWaspRootFileInWaspProjectDir,
|
|
|
|
extCodeDirInWaspProjectDir,
|
|
|
|
generatedCodeDirInDotWaspDir,
|
|
|
|
buildDirInDotWaspDir,
|
|
|
|
waspSays,
|
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
import Common (WaspProjectDir)
|
|
|
|
import ExternalCode (SourceExternalCodeDir)
|
2020-09-07 22:55:13 +03:00
|
|
|
import qualified Generator.Common
|
2021-07-03 12:00:01 +03:00
|
|
|
import StrongPath (Dir, File', Path', Rel, reldir, relfile)
|
2021-04-28 18:36:00 +03:00
|
|
|
import qualified Util.Terminal as Term
|
2020-09-07 22:55:13 +03:00
|
|
|
|
|
|
|
data DotWaspDir -- Here we put everything that wasp generates.
|
|
|
|
|
2021-04-28 18:36:00 +03:00
|
|
|
data CliTemplatesDir
|
2021-02-01 19:37:42 +03:00
|
|
|
|
2020-09-07 22:55:13 +03:00
|
|
|
-- TODO: SHould this be renamed to include word "root"?
|
2021-07-03 12:00:01 +03:00
|
|
|
dotWaspDirInWaspProjectDir :: Path' (Rel WaspProjectDir) (Dir DotWaspDir)
|
|
|
|
dotWaspDirInWaspProjectDir = [reldir|.wasp|]
|
2020-09-07 22:55:13 +03:00
|
|
|
|
|
|
|
-- TODO: Hm this has different name than it has in Generator.
|
2021-07-03 12:00:01 +03:00
|
|
|
generatedCodeDirInDotWaspDir :: Path' (Rel DotWaspDir) (Dir Generator.Common.ProjectRootDir)
|
|
|
|
generatedCodeDirInDotWaspDir = [reldir|out|]
|
2020-09-07 22:55:13 +03:00
|
|
|
|
2021-07-03 12:00:01 +03:00
|
|
|
buildDirInDotWaspDir :: Path' (Rel DotWaspDir) (Dir Generator.Common.ProjectRootDir)
|
|
|
|
buildDirInDotWaspDir = [reldir|build|]
|
2021-02-01 19:37:42 +03:00
|
|
|
|
2021-07-03 12:00:01 +03:00
|
|
|
dotWaspRootFileInWaspProjectDir :: Path' (Rel WaspProjectDir) File'
|
|
|
|
dotWaspRootFileInWaspProjectDir = [relfile|.wasproot|]
|
2020-09-07 22:55:13 +03:00
|
|
|
|
2021-07-03 12:00:01 +03:00
|
|
|
extCodeDirInWaspProjectDir :: Path' (Rel WaspProjectDir) (Dir SourceExternalCodeDir)
|
|
|
|
extCodeDirInWaspProjectDir = [reldir|ext|]
|
2020-09-11 18:31:17 +03:00
|
|
|
|
|
|
|
waspSays :: String -> IO ()
|
2020-10-15 19:17:40 +03:00
|
|
|
waspSays what = putStrLn $ Term.applyStyles [Term.Yellow] what
|