{-# LANGUAGE NoImplicitPrelude #-}
module Stack.DockerCmd
( dockerPullCmd
, dockerResetCmd
) where
import Stack.Docker ( preventInContainer, pull, reset )
import Stack.Prelude
import Stack.Runners ( ShouldReexec (..), withConfig )
import Stack.Types.Runner ( Runner )
dockerPullCmd :: () -> RIO Runner ()
dockerPullCmd :: () -> RIO Runner ()
dockerPullCmd () = ShouldReexec -> RIO Config () -> RIO Runner ()
forall a. ShouldReexec -> RIO Config a -> RIO Runner a
withConfig ShouldReexec
NoReexec (RIO Config () -> RIO Runner ()) -> RIO Config () -> RIO Runner ()
forall a b. (a -> b) -> a -> b
$ RIO Config () -> RIO Config ()
forall (m :: * -> *). MonadIO m => m () -> m ()
preventInContainer RIO Config ()
forall env. HasConfig env => RIO env ()
pull
dockerResetCmd ::
Bool
-> RIO Runner ()
dockerResetCmd :: Bool -> RIO Runner ()
dockerResetCmd = ShouldReexec -> RIO Config () -> RIO Runner ()
forall a. ShouldReexec -> RIO Config a -> RIO Runner a
withConfig ShouldReexec
NoReexec (RIO Config () -> RIO Runner ())
-> (Bool -> RIO Config ()) -> Bool -> RIO Runner ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RIO Config () -> RIO Config ()
forall (m :: * -> *). MonadIO m => m () -> m ()
preventInContainer (RIO Config () -> RIO Config ())
-> (Bool -> RIO Config ()) -> Bool -> RIO Config ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> RIO Config ()
forall env. HasConfig env => Bool -> RIO env ()
reset