Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2017 08:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save notcome/05d54edbf26262969b6d3a0c1011e050 to your computer and use it in GitHub Desktop.
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