mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Enhancement - shadow files
- Properly clears out the context, so shadow files can work.
This commit is contained in:
parent
52fb6abb9b
commit
40bde9e765
2 changed files with 10 additions and 4 deletions
|
@ -219,9 +219,8 @@ std::string Context::dispatch ()
|
||||||
else { out = shortUsage (); }
|
else { out = shortUsage (); }
|
||||||
|
|
||||||
// Only update the shadow file if such an update was not suppressed (shadow),
|
// Only update the shadow file if such an update was not suppressed (shadow),
|
||||||
// TODO
|
if (cmd.isWriteCommand () && !inShadow)
|
||||||
// if (cmd.isWriteCommand (cmd.command) && !inShadow))
|
shadow ();
|
||||||
// shadow ();
|
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
@ -252,6 +251,8 @@ void Context::shadow ()
|
||||||
config.set ("curses", "off");
|
config.set ("curses", "off");
|
||||||
config.set ("color", "off");
|
config.set ("color", "off");
|
||||||
|
|
||||||
|
clear ();
|
||||||
|
|
||||||
// Run report. Use shadow.command, using default.command as a fallback
|
// Run report. Use shadow.command, using default.command as a fallback
|
||||||
// with "list" as a default.
|
// with "list" as a default.
|
||||||
std::string command = config.get ("shadow.command",
|
std::string command = config.get ("shadow.command",
|
||||||
|
@ -261,7 +262,6 @@ void Context::shadow ()
|
||||||
initialize ();
|
initialize ();
|
||||||
parse ();
|
parse ();
|
||||||
std::string result = dispatch ();
|
std::string result = dispatch ();
|
||||||
|
|
||||||
std::ofstream out (shadowFile.c_str ());
|
std::ofstream out (shadowFile.c_str ());
|
||||||
if (out.good ())
|
if (out.good ())
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,3 +9,9 @@ done
|
||||||
|
|
||||||
date >> all.log
|
date >> all.log
|
||||||
|
|
||||||
|
echo -n 'Pass: '
|
||||||
|
grep ^ok all.log | wc -l
|
||||||
|
|
||||||
|
echo -n 'Fail: '
|
||||||
|
grep ^not all.log | wc -l
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue