From: Mikko Rasa Date: Thu, 29 Dec 2022 12:54:52 +0000 (+0200) Subject: Reject nonexistent sources X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4a12781c1246126e93dbc35522b71f89b919b427;p=builder.git Reject nonexistent sources --- diff --git a/source/lib/component.cpp b/source/lib/component.cpp index 4fddcef..77fbe12 100644 --- a/source/lib/component.cpp +++ b/source/lib/component.cpp @@ -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); }