FileSaver: count how many files failed, Commands: Show how many failed

This commit is contained in:
2019-04-26 22:46:33 +02:00
parent 098cd96dd2
commit 7df1ddf891
4 changed files with 21 additions and 15 deletions

View File

@@ -93,11 +93,14 @@ int CommandUpdate::handle(QStringList arguments)
}
}
if(!saver.updateFiles(filePathsToUpdate, keepGoing, verbose))
int updatedFilesCount = saver.updateFiles(filePathsToUpdate, keepGoing, verbose);
int shouldHaveUpdatedCount = filePathsToUpdate.size();
if(updatedFilesCount != shouldHaveUpdatedCount)
{
if(!keepGoing)
{
Logger::error() << "Failed to update all files selected for updating" << endl;
Logger::error() << "Failed to update all files selected for updating. Updated" << updatedFilesCount
<< "out of" << shouldHaveUpdatedCount << "selected for upating" << endl;
return 1;
}
}