Give an error in dcpomatic_cli if a content file is not found.
authorCarl Hetherington <cth@carlh.net>
Sun, 19 Oct 2014 21:02:11 +0000 (22:02 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 19 Oct 2014 21:02:11 +0000 (22:02 +0100)
src/tools/dcpomatic_cli.cc

index 5cb05e11d5ce23721d5acff9c1ab530550022325..23ca938d4e49c7ec77d5bb0dd3b185908f891884 100644 (file)
@@ -139,6 +139,17 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
+       ContentList content = film->content ();
+       for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
+               vector<boost::filesystem::path> paths = (*i)->paths ();
+               for (vector<boost::filesystem::path>::const_iterator j = paths.begin(); j != paths.end(); ++j) {
+                       if (!boost::filesystem::exists (*j)) {
+                               cerr << argv[0] << ": content file " << *j << " not found.\n";
+                               exit (EXIT_FAILURE);
+                       }
+               }
+       }
+               
        cout << "\nMaking DCP for " << film->name() << "\n";
 
        film->make_dcp ();