The default ledger file is now ~/.ledger
This commit is contained in:
parent
18a1c8a3fb
commit
8b3a75fbbf
1 changed files with 10 additions and 2 deletions
|
|
@ -121,8 +121,16 @@ std::size_t session_t::read_journal(const path& pathname,
|
||||||
|
|
||||||
std::size_t session_t::read_data(const string& master_account)
|
std::size_t session_t::read_data(const string& master_account)
|
||||||
{
|
{
|
||||||
if (HANDLER(file_).data_files.empty())
|
if (HANDLER(file_).data_files.empty()) {
|
||||||
throw_(parse_error, "No journal file was specified (please use -f)");
|
path file;
|
||||||
|
if (const char * home_var = std::getenv("HOME"))
|
||||||
|
file = path(home_var) / ".ledger";
|
||||||
|
|
||||||
|
if (! file.empty() && exists(file))
|
||||||
|
HANDLER(file_).data_files.push_back(file);
|
||||||
|
else
|
||||||
|
throw_(parse_error, "No journal file was specified (please use -f)");
|
||||||
|
}
|
||||||
|
|
||||||
std::size_t xact_count = 0;
|
std::size_t xact_count = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue