Skip to content

Instantly share code, notes, and snippets.

@notcome
Created February 28, 2017 08:39
Embed
What would you like to do?
Haskell as script via Turtle, an example
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
{-# LANGUAGE OverloadedStrings #-}
import Turtle
main = do
containerArg <- format (fp%":/latex") <$> pwd
userArgs <- arguments
let dockerArgs = ["run", "-v", containerArg,
"minsheng/latex:latest"] ++ userArgs
result <- proc "docker" dockerArgs empty
case result of
ExitSuccess ->
return ()
ExitFailure exitCode ->
print $ format ("Docker fails with exit code "%d) exitCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment