mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Add curly braces to if-statements
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
592f4b8b6e
commit
17f9e8727c
1 changed files with 9 additions and 0 deletions
|
@ -164,6 +164,7 @@ void initializeDataJournalAndRules (
|
||||||
|
|
||||||
// If dbLocation does not exist, ask whether it should be created.
|
// If dbLocation does not exist, ask whether it should be created.
|
||||||
bool shinyNewDatabase = false;
|
bool shinyNewDatabase = false;
|
||||||
|
|
||||||
if (! dbLocation.exists () &&
|
if (! dbLocation.exists () &&
|
||||||
(findHint (cli, ":yes") ||
|
(findHint (cli, ":yes") ||
|
||||||
confirm ("Create new database in " + dbLocation._data + "?")))
|
confirm ("Create new database in " + dbLocation._data + "?")))
|
||||||
|
@ -175,22 +176,30 @@ void initializeDataJournalAndRules (
|
||||||
// Create extensions subdirectory if necessary.
|
// Create extensions subdirectory if necessary.
|
||||||
Directory extensions (dbLocation);
|
Directory extensions (dbLocation);
|
||||||
extensions += "extensions";
|
extensions += "extensions";
|
||||||
|
|
||||||
if (! extensions.exists ())
|
if (! extensions.exists ())
|
||||||
|
{
|
||||||
extensions.create (0700);
|
extensions.create (0700);
|
||||||
|
}
|
||||||
|
|
||||||
// Create data subdirectory if necessary.
|
// Create data subdirectory if necessary.
|
||||||
Directory data (dbLocation);
|
Directory data (dbLocation);
|
||||||
data += "data";
|
data += "data";
|
||||||
|
|
||||||
if (! data.exists ())
|
if (! data.exists ())
|
||||||
|
{
|
||||||
data.create (0700);
|
data.create (0700);
|
||||||
|
}
|
||||||
|
|
||||||
// Load the configuration data.
|
// Load the configuration data.
|
||||||
Path configFile (dbLocation);
|
Path configFile (dbLocation);
|
||||||
configFile += "timewarrior.cfg";
|
configFile += "timewarrior.cfg";
|
||||||
|
|
||||||
if (! configFile.exists ())
|
if (! configFile.exists ())
|
||||||
{
|
{
|
||||||
File (configFile).create (0600);
|
File (configFile).create (0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
rules.load (configFile._data);
|
rules.load (configFile._data);
|
||||||
|
|
||||||
// This value is not written out to disk, as there would be no point.
|
// This value is not written out to disk, as there would be no point.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue