aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:21:09 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:21:09 +0000
commit427c2e484ded241d073e80b3a90be0005509a085 (patch)
treef24cc03ee295dced8ee1a27fd65cebace845602f /Setup.hs
parentba6981a4a1bf050c9faadd1ddc6388209a66405d (diff)
downloadpandoc-427c2e484ded241d073e80b3a90be0005509a085.tar.gz
Modified Setup.hs with new location for DefaultHeaders.hs.
Print template notice on top of autogenerated source files. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1220 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Setup.hs b/Setup.hs
index ec035614e..977b6494e 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -52,8 +52,8 @@ myPostClean :: Args -> CleanFlags -> PackageDescription -> Maybe LocalBuildInfo
myPostClean _ _ _ _ = do
putStrLn "Removing source files generated from templates:"
removeGeneratedFile $ joinPath [pandocPath, "ASCIIMathML.hs"]
+ removeGeneratedFile $ joinPath [pandocPath, "DefaultHeaders.hs"]
removeGeneratedFile $ joinPath [pandocPath, "Writers", "S5.hs"]
- removeGeneratedFile $ joinPath [pandocPath, "Writers", "DefaultHeaders.hs"]
-- Remove file and print message.
removeGeneratedFile :: FilePath -> IO ()
@@ -65,7 +65,9 @@ removeGeneratedFile fpath = do
writeTemplate :: FilePath -> String -> IO ()
writeTemplate outfile contents = do
putStrLn $ " " ++ outfile
- writeFile outfile contents
+ let warning = "-- This file is generated from a template in the templates subdirectory.\n\
+ \-- Modify that file, not this one.\n"
+ writeFile outfile (warning ++ contents)
-- Read contents of fpath and insert in template replacing @fpath@.
processFile :: String -> FilePath -> IO String