module Buffet.Assemble.HasArgInstructionWithName
  ( get
  ) where

import qualified Buffet.Ir.Ir as Ir
import qualified Language.Docker as Docker
import Prelude (Bool(False), (==), any)

get :: Ir.Option -> Ir.DockerfilePart -> Bool
get :: Option -> DockerfilePart -> Bool
get Option
option = (Instruction Text -> Bool) -> DockerfilePart -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any Instruction Text -> Bool
forall args. Instruction args -> Bool
isArgWithName
  where
    isArgWithName :: Instruction args -> Bool
isArgWithName (Docker.Arg Text
name Maybe Text
_) = Text
name Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
optionName
    isArgWithName Instruction args
_ = Bool
False
    optionName :: Text
optionName = Option -> Text
Ir.option Option
option