tools: hakyll isn't in lts 7, use nightly for hakyll-std

Also compile it when run interpreted.
This commit is contained in:
Simon Michael 2016-12-29 11:14:36 -08:00
parent ff6ca9cc43
commit eaf8853a9f
3 changed files with 12 additions and 10 deletions

View File

@ -875,7 +875,7 @@ hakyll-std site/hakyll-std/hakyll-std: \
site/hakyll-std/hakyll-std.hs \
site/hakyll-std/TableOfContents.hs \
$(call def-help,hakyll-std, build a generic hakyll site builder script )
cd site/hakyll-std; ./hakyll-std.hs >/dev/null && stack ghc hakyll-std.hs
cd site/hakyll-std; ./hakyll-std.hs
site-build: site/hakyll-std/hakyll-std site/manual.md \
$(call def-help,site-build, generate the hledger.org website with hakyll-std )

View File

@ -264,19 +264,14 @@ main = do
hakyllstd %> \out -> do
let dir = takeDirectory out
need [out <.> "hs", dir </> "TableOfContents.hs"] -- XXX hard-coded dep
-- install libs via shebang line
-- XXX 2016/10/29 why has this started giving
-- "./hakyll-std.hs: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory))"
unit $ liftIO $
cmd (Cwd dir) "./hakyll-std.hs --version"
cmd (Cwd dir) "./hakyll-std.hs"
`catch` (\(e::IOException) -> putStr $ unlines $
["I could not run ./hakyll-std.hs in "++dir++" to install Hakyll."
,"If you see a hakyll-std build error after this, please do it manually:"
,"$ (cd site/hakyll-std; ./hakyll-std.hs --version)"
,"$ (cd site/hakyll-std; ./hakyll-std.hs)"
,"and try again."
])
-- compile
cmd (Cwd dir) "stack ghc hakyll-std"
-- cleanup

View File

@ -1,6 +1,11 @@
#!/usr/bin/env stack
{- stack runghc --verbosity info --package hakyll --package pandoc -} -- pandoc-1.17.0.3
{-# LANGUAGE OverloadedStrings #-}
{- stack exec --verbosity info
--resolver nightly
--package hakyll
--package pandoc
-- ghc
-}
{- |
A simple hakyll website builder suitable for software project sites,
@ -31,6 +36,8 @@ $ hakyll-std [--help|clean|build|preview|...] # standard hakyll options
-}
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import Data.Default
import Hakyll