mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 06:05:31 +03:00
Use build --skip-dist instead of generate
This commit is contained in:
parent
4da355b17e
commit
8b4d92d4ca
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user