The smallest fix to your code is to use phony
like @Cactus suggests. An alternative is to use action
directly:
import Development.Shake
import Control.Monad (unless)
main = shakeArgs shakeOptions $ do
action $ do
ok <- fmap (== "yes") $ liftIO $ putStrLn "You sure?" >> getLine
unless ok $ fail "Your commitment to the Great War is lacking!"
liftIO $ putStrLn "Missiles fired!"
If instead of running the fire missiles at any point during the build, you actually want to run it at the end (after you have built the missiles and stocked up on tin cans), you can write:
main = do
shakeArgs shakeOptions $ do
...normal build rules go here...
ok <- fmap (== "yes") $ putStrLn "You sure?" >> getLine
unless ok $ fail "Your commitment to the Great War is lacking!"
putStrLn "Missiles fired!"
Here you are using normal Haskell to fire the missiles, after running the Shake build.