mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Rules: Replacing Configuration
This commit is contained in:
parent
16cd5a6501
commit
f3aa253b07
3 changed files with 9 additions and 10 deletions
12
src/init.cpp
12
src/init.cpp
|
@ -55,6 +55,7 @@ bool lightweightVersionCheck (const std::vector <std::string>& args)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void initializeData (
|
||||
Database& database,
|
||||
Rules& rules,
|
||||
Log& log)
|
||||
{
|
||||
// The $TIMEWARRIORDB environment variable overrides the default value of
|
||||
|
@ -88,7 +89,7 @@ void initializeData (
|
|||
if (! extensions.exists ())
|
||||
extensions.create (0700);
|
||||
|
||||
// Create extensions subdirectory if necessary.
|
||||
// Create data subdirectory if necessary.
|
||||
Directory data (dbLocation);
|
||||
data += "data";
|
||||
if (! data.exists ())
|
||||
|
@ -107,22 +108,19 @@ void initializeData (
|
|||
File configFile (dbLocation);
|
||||
configFile += "timewarrior.cfg";
|
||||
configFile.create (0600);
|
||||
/*
|
||||
configuration.load (configFile._data);
|
||||
*/
|
||||
|
||||
// This value is not written out to disk, as there would be no point. Having
|
||||
// located the config file, the 'db' location is already known. This is just
|
||||
// for subsequent internal use.
|
||||
/*
|
||||
configuration.set ("db", dbLocation._data);
|
||||
log.write ("info", std::string (" rc.db=") + configuration.get ("db"));
|
||||
rules.set ("db", dbLocation._data);
|
||||
log.write ("info", std::string (" rc.db=") + rules.get ("db"));
|
||||
*/
|
||||
|
||||
// Perhaps some subsequent code would like to know this is a new db and
|
||||
// possibly a first run.
|
||||
/*
|
||||
configuration.set ("shiny", (shinyNewDatabase ? 1 : 0));
|
||||
rules.set ("shiny", (shinyNewDatabase ? 1 : 0));
|
||||
*/
|
||||
|
||||
// Initialize the database (no data read), but files are enumerated.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue