Use build --skip-dist instead of generate

This commit is contained in:
Phill Sparks 2020-07-14 21:55:57 +01:00
parent 4da355b17e
commit 8b4d92d4ca
No known key found for this signature in database
GPG Key ID: DA53DF9BB8928B10

View File

@ -151,8 +151,7 @@ generateMarkdownPage markdown =
type CliOptions
= Develop DevelopOptions
| Build
| Generate
| Build BuildOptions
type alias DevelopOptions =
@ -161,6 +160,11 @@ type alias DevelopOptions =
}
type alias BuildOptions =
{ skipDist : Bool
}
application : Program.Config CliOptions
application =
Program.config
@ -175,9 +179,10 @@ application =
|> OptionsParser.map Develop
)
|> Program.add
(OptionsParser.buildSubCommand "build" Build)
|> Program.add
(OptionsParser.buildSubCommand "generate" Generate)
(OptionsParser.buildSubCommand "build" BuildOptions
|> with (Option.flag "skip-dist")
|> OptionsParser.map Build
)
type alias Flags =
@ -210,11 +215,8 @@ init flags cliOptions =
Develop options ->
( Start, options.debugger, options.customPort )
Build ->
( Run, False, Nothing )
Generate ->
( None, False, Nothing )
Build options ->
( buildDevelopMode options, False, Nothing )
in
{ develop = develop
, debug = debug
@ -224,6 +226,15 @@ init flags cliOptions =
|> writeFile
buildDevelopMode : BuildOptions -> DevelopMode
buildDevelopMode { skipDist } =
if skipDist then
None
else
Run
encodeWriteFile : { develop : DevelopMode, debug : Bool, customPort : Maybe Int } -> Encode.Value
encodeWriteFile { develop, debug, customPort } =
Encode.object