allow tilde in LEDGER env var

This commit is contained in:
Simon Michael 2007-03-10 23:18:46 +00:00
parent 7d2a868640
commit ee8ac17909

View File

@ -36,6 +36,7 @@ getLedgerFilePath :: [Flag] -> IO String
getLedgerFilePath opts = do
defaultpath <- tildeExpand "~/ledger.dat"
envordefault <- getEnv "LEDGER" `catch` \_ -> return defaultpath
path <- tildeExpand envordefault
return $ last $ [envordefault] ++ (filter (/= "") (map getFile opts))
-- ledger pattern args are a list of account patterns optionally followed