mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 03:11:30 +03:00
Give error status code for invalid CLI arguments.
This commit is contained in:
parent
4c93e64cae
commit
f368bb358e
@ -137,9 +137,20 @@ app config =
|
||||
)
|
||||
]
|
||||
, config = cliConfig
|
||||
|
||||
-- TODO printAndExitFailure needs to trigger error exit code
|
||||
, printAndExitFailure = \string -> config.toJsPort (Json.Encode.string string) |> Cmd.map never
|
||||
, printAndExitFailure =
|
||||
\string ->
|
||||
ToJsPayload.Errors
|
||||
[ { title = "Invalid CLI arguments"
|
||||
, path = ""
|
||||
, message =
|
||||
[ Terminal.text string
|
||||
]
|
||||
, fatal = True
|
||||
}
|
||||
]
|
||||
|> Codec.encodeToValue (ToJsPayload.successCodecNew2 "" "")
|
||||
|> config.toJsPort
|
||||
|> Cmd.map never
|
||||
, printAndExitSuccess = \string -> config.toJsPort (Json.Encode.string string) |> Cmd.map never
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user