From eaf8853a9f646904e16703188e96715ab00aac55 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 29 Dec 2016 11:14:36 -0800 Subject: [PATCH] tools: hakyll isn't in lts 7, use nightly for hakyll-std Also compile it when run interpreted. --- Makefile | 2 +- Shake.hs | 9 ++------- site/hakyll-std/hakyll-std.hs | 11 +++++++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 6c367e414..ab9b28884 100644 --- a/Makefile +++ b/Makefile @@ -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 ) diff --git a/Shake.hs b/Shake.hs index 9fe3a630d..c402f4430 100755 --- a/Shake.hs +++ b/Shake.hs @@ -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 diff --git a/site/hakyll-std/hakyll-std.hs b/site/hakyll-std/hakyll-std.hs index 12e897547..6db8489d1 100755 --- a/site/hakyll-std/hakyll-std.hs +++ b/site/hakyll-std/hakyll-std.hs @@ -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