forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerCmd.hs
More file actions
25 lines (21 loc) · 837 Bytes
/
Copy pathDockerCmd.hs
File metadata and controls
25 lines (21 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# LANGUAGE NoImplicitPrelude #-}
-- | Functions related to Stack's @docker pull@ and @docker reset@ commands.
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 )
-- | Function underlying the @stack docker pull@ command. Pull the current
-- Docker image.
dockerPullCmd :: () -> RIO Runner ()
dockerPullCmd () = withConfig NoReexec $ preventInContainer pull
-- | Function underlying the @stack docker reset@ command. Reset the Docker
-- sandbox.
dockerResetCmd ::
Bool
-- ^ Delete the sandbox's home directory?
-> RIO Runner ()
dockerResetCmd = withConfig NoReexec . preventInContainer . reset