mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1441
- TW-1441 task import continues happily if filename doesn't exist.
This commit is contained in:
parent
18581a6ca4
commit
5275c0ce60
10 changed files with 44 additions and 3 deletions
|
@ -61,12 +61,15 @@ int CmdImport::execute (std::string& output)
|
|||
std::vector <std::string>::iterator word;
|
||||
for (word = words.begin (); word != words.end (); ++word)
|
||||
{
|
||||
std::string file = *word;
|
||||
std::cout << format (STRING_CMD_IMPORT_FILE, file) << "\n";
|
||||
File incoming (*word);
|
||||
if (! incoming.exists ())
|
||||
throw format (STRING_CMD_IMPORT_MISSING, *word);
|
||||
|
||||
std::cout << format (STRING_CMD_IMPORT_FILE, *word) << "\n";
|
||||
|
||||
// Load the file.
|
||||
std::vector <std::string> lines;
|
||||
File::read (file, lines);
|
||||
incoming.read (lines);
|
||||
|
||||
std::vector <std::string>::iterator line;
|
||||
for (line = lines.begin (); line != lines.end (); ++line)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue