mirror of
https://github.com/NorfairKing/feedback.git
synced 2024-11-27 00:47:13 +03:00
Do not require a command key in the config file
This commit is contained in:
parent
343ab6a5a8
commit
77bde208d8
@ -1,5 +1,3 @@
|
||||
loops:
|
||||
ci:
|
||||
command: nix-build ci.nix
|
||||
install:
|
||||
command: stack install
|
||||
ci: nix-build ci.nix --no-out-link
|
||||
install: stack install
|
||||
|
@ -1,5 +1,6 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DerivingVia #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE OverloadedLists #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
@ -97,9 +98,16 @@ data LoopConfiguration = LoopConfiguration
|
||||
|
||||
instance HasCodec LoopConfiguration where
|
||||
codec =
|
||||
dimapCodec f g $
|
||||
eitherCodec codec $
|
||||
object "LoopConfiguration" $
|
||||
LoopConfiguration
|
||||
<$> requiredField "command" "the command to run on change" .= loopConfigCommand
|
||||
where
|
||||
f = \case
|
||||
Left command -> LoopConfiguration {loopConfigCommand = command}
|
||||
Right loopConfig -> loopConfig
|
||||
g (LoopConfiguration command) = Left command
|
||||
|
||||
data OutputConfiguration = OutputConfiguration
|
||||
{ outputConfigClear :: !(Maybe Clear)
|
||||
|
Loading…
Reference in New Issue
Block a user