- Fixed bug #257 where an extant ~/.taskrc file prevented the override and
  automatic creation of an alternate rc file (thanks to Zach Frazier).
This commit is contained in:
Paul Beckingham 2009-08-07 16:11:09 -06:00
parent 1355571876
commit a7196ca181
2 changed files with 22 additions and 8 deletions

View file

@ -20,6 +20,8 @@
+ Fixed bug #252 that prevented use of attribute modifiers on dates to effect
a range, such as "task ls due.after:eom due.before:eoy" (thanks to John
Florian).
+ Fixed bug #257 where an extant ~/.taskrc file prevented the override and
automatic creation of an alternate rc file (thanks to Zach Frazier).
------ old releases ------------------------------

View file

@ -339,6 +339,14 @@ void Context::loadCorrectConfigFile ()
else if (arg->substr (0, 3) == "rc:")
{
rc = arg->substr (3, std::string::npos);
home = rc;
std::string::size_type last_slash = rc.rfind ("/");
if (last_slash != std::string::npos)
home = rc.substr (0, last_slash);
else
home = ".";
args.erase (arg);
header ("Using alternate .taskrc file " + rc); // TODO i18n
break;
@ -367,8 +375,9 @@ void Context::loadCorrectConfigFile ()
}
// Do we need to create a default rc?
if (access (rc.c_str (), F_OK) &&
confirm ("A configuration file could not be found in " // TODO i18n
if (access (rc.c_str (), F_OK))
{
if (confirm ("A configuration file could not be found in " // TODO i18n
+ home
+ "\n\n"
+ "Would you like a sample "
@ -377,6 +386,9 @@ void Context::loadCorrectConfigFile ()
{
config.createDefaultRC (rc, data);
}
else
throw std::string ("Cannot proceed without rc file.");
}
// Create data location, if necessary.
config.createDefaultData (data);