Created
February 28, 2017 08:39
-
-
Save notcome/05d54edbf26262969b6d3a0c1011e050 to your computer and use it in GitHub Desktop.
Haskell as script via Turtle, an example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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