Skip to content

Commit

Permalink
Use CPP to insert version number, so version bump only requires chang…
Browse files Browse the repository at this point in the history
…ing cabal file.
  • Loading branch information
jgm committed Jan 29, 2009
1 parent 73db5a1 commit 5b52668
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Gitit.hs
@@ -1,4 +1,4 @@
{-# LANGUAGE Rank2Types, FlexibleContexts #-}
{-# LANGUAGE CPP, Rank2Types, FlexibleContexts #-}
{-
Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
Expand Down Expand Up @@ -60,9 +60,6 @@ import Network.Socket
import Network.Captcha.ReCaptcha (captchaFields, validateCaptcha)
import Data.FileStore

gititVersion :: String
gititVersion = "0.5"

sessionTime :: Int
sessionTime = 60 * 60 -- session will expire 1 hour after page request

Expand Down Expand Up @@ -174,7 +171,7 @@ handleFlag _ opt = do
progname <- getProgName
case opt of
Help -> hPutStrLn stderr (usageInfo (usageHeader progname) flags) >> exitWith ExitSuccess
Version -> hPutStrLn stderr (progname ++ " version " ++ gititVersion ++ copyrightMessage) >> exitWith ExitSuccess
Version -> hPutStrLn stderr (progname ++ " version " ++ _VERSION ++ copyrightMessage) >> exitWith ExitSuccess
ConfigFile f -> liftM read (readFile f)

type Handler = ServerPart Response
Expand Down
1 change: 1 addition & 0 deletions gitit.cabal
Expand Up @@ -53,5 +53,6 @@ Executable gitit
if impl(ghc >= 6.10)
build-depends: base >= 4, syb
ghc-options: -Wall -threaded
cpp-options: -D_VERSION="0.5"
ghc-prof-options: -auto-all

0 comments on commit 5b52668

Please sign in to comment.