mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug Fix - #257
- 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:
parent
1355571876
commit
a7196ca181
2 changed files with 22 additions and 8 deletions
|
@ -20,6 +20,8 @@
|
||||||
+ Fixed bug #252 that prevented use of attribute modifiers on dates to effect
|
+ 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
|
a range, such as "task ls due.after:eom due.before:eoy" (thanks to John
|
||||||
Florian).
|
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 ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|
|
@ -339,6 +339,14 @@ void Context::loadCorrectConfigFile ()
|
||||||
else if (arg->substr (0, 3) == "rc:")
|
else if (arg->substr (0, 3) == "rc:")
|
||||||
{
|
{
|
||||||
rc = arg->substr (3, std::string::npos);
|
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);
|
args.erase (arg);
|
||||||
header ("Using alternate .taskrc file " + rc); // TODO i18n
|
header ("Using alternate .taskrc file " + rc); // TODO i18n
|
||||||
break;
|
break;
|
||||||
|
@ -367,8 +375,9 @@ void Context::loadCorrectConfigFile ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we need to create a default rc?
|
// Do we need to create a default rc?
|
||||||
if (access (rc.c_str (), F_OK) &&
|
if (access (rc.c_str (), F_OK))
|
||||||
confirm ("A configuration file could not be found in " // TODO i18n
|
{
|
||||||
|
if (confirm ("A configuration file could not be found in " // TODO i18n
|
||||||
+ home
|
+ home
|
||||||
+ "\n\n"
|
+ "\n\n"
|
||||||
+ "Would you like a sample "
|
+ "Would you like a sample "
|
||||||
|
@ -377,6 +386,9 @@ void Context::loadCorrectConfigFile ()
|
||||||
{
|
{
|
||||||
config.createDefaultRC (rc, data);
|
config.createDefaultRC (rc, data);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
throw std::string ("Cannot proceed without rc file.");
|
||||||
|
}
|
||||||
|
|
||||||
// Create data location, if necessary.
|
// Create data location, if necessary.
|
||||||
config.createDefaultData (data);
|
config.createDefaultData (data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue