git.iko.soy/typeable/pandoc
on master help sign in
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

commit427c2e484ded241d073e80b3a90be0005509a085 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 9 Feb 2008, 03:21 (19 years ago) parentba6981a
1 file changed+4−2
Setup.hs+4−2
Setup.hs+4−2
@@ -52,8 +52,8 @@ myPostClean :: Args -> CleanFlags -> PackageDescription -> Maybe LocalBuildInfo
5252myPostClean _ _ _ _ = do
5353 putStrLn "Removing source files generated from templates:"
5454 removeGeneratedFile $ joinPath [pandocPath, "ASCIIMathML.hs"]
55+ removeGeneratedFile $ joinPath [pandocPath, "DefaultHeaders.hs"]
5556 removeGeneratedFile $ joinPath [pandocPath, "Writers", "S5.hs"]
56− removeGeneratedFile $ joinPath [pandocPath, "Writers", "DefaultHeaders.hs"]
5757
5858-- Remove file and print message.
5959removeGeneratedFile :: FilePath -> IO ()
@@ -65,7 +65,9 @@ removeGeneratedFile fpath = do
6565writeTemplate :: FilePath -> String -> IO ()
6666writeTemplate outfile contents = do
6767 putStrLn $ " " ++ outfile
68− writeFile outfile contents
68+ let warning = "-- This file is generated from a template in the templates subdirectory.\n\
69+ \-- Modify that file, not this one.\n"
70+ writeFile outfile (warning ++ contents)
6971
7072-- Read contents of fpath and insert in template replacing @fpath@.
7173processFile :: String -> FilePath -> IO String