mirror of
https://github.com/NorfairKing/feedback.git
synced 2024-11-30 12:12:00 +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:
|
loops:
|
||||||
ci:
|
ci: nix-build ci.nix --no-out-link
|
||||||
command: nix-build ci.nix
|
install: stack install
|
||||||
install:
|
|
||||||
command: stack install
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{-# LANGUAGE DeriveGeneric #-}
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
{-# LANGUAGE DerivingVia #-}
|
{-# LANGUAGE DerivingVia #-}
|
||||||
|
{-# LANGUAGE LambdaCase #-}
|
||||||
{-# LANGUAGE OverloadedLists #-}
|
{-# LANGUAGE OverloadedLists #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
@ -97,9 +98,16 @@ data LoopConfiguration = LoopConfiguration
|
|||||||
|
|
||||||
instance HasCodec LoopConfiguration where
|
instance HasCodec LoopConfiguration where
|
||||||
codec =
|
codec =
|
||||||
|
dimapCodec f g $
|
||||||
|
eitherCodec codec $
|
||||||
object "LoopConfiguration" $
|
object "LoopConfiguration" $
|
||||||
LoopConfiguration
|
LoopConfiguration
|
||||||
<$> requiredField "command" "the command to run on change" .= loopConfigCommand
|
<$> 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
|
data OutputConfiguration = OutputConfiguration
|
||||||
{ outputConfigClear :: !(Maybe Clear)
|
{ outputConfigClear :: !(Maybe Clear)
|
||||||
|
Loading…
Reference in New Issue
Block a user