]> git.tdb.fi Git - builder.git/commitdiff
Reject nonexistent sources
authorMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2022 12:54:52 +0000 (14:54 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2022 12:54:52 +0000 (14:54 +0200)
source/lib/component.cpp

index 4fddcef79de59a9ca0ca6cf05e8a5b71ec565a79..77fbe122dc062dcfe9628bb8446e0d6034b7cd68 100644 (file)
@@ -176,5 +176,8 @@ void Component::Loader::require(const string &n)
 
 void Component::Loader::source(const string &s)
 {
-       obj.sources.push_back((obj.package.get_source_directory()/s).str());
+       FS::Path src_path = obj.package.get_source_directory()/s;
+       if(!FS::exists(src_path))
+               throw IO::file_not_found(src_path.str());
+       obj.sources.push_back(src_path);
 }