"make release" extracts version number from Options.hs, tags and uploads to hackage

This commit is contained in:
Simon Michael 2008-11-23 22:15:51 +00:00
parent 7db0881b40
commit 6cd97f3f64
2 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,10 @@ test:
@./hledger.hs test
@./regtest.py
VERSION=`grep 'versionno =' Options.hs | perl -pe 's/.*"(.*?)"/\1/'`
release:
cabal sdist && darcs tag $(VERSION) && cabal upload dist/hledger-$(VERSION).tar.gz
tag:
rm -f TAGS; hasktags -e *hs Ledger/*hs

View File

@ -3,6 +3,7 @@ where
import System
import System.Console.GetOpt
import System.Directory
import Text.Printf
import Ledger.AccountName (negativepatternchar)
usagehdr = "Usage: hledger [OPTS] balance|print|register [ACCTPATS] [-- DESCPATS]\n\nOptions"++warning++":"
@ -46,7 +47,8 @@ data Opt =
usage = usageInfo usagehdr options ++ usageftr
version = "hledger version 0.2 \n"
versionno = "0.2"
version = printf "hledger version %s \n" versionno :: String
-- | Parse the command-line arguments into ledger options, ledger command
-- name, and ledger command arguments