Skip to content

Commit

Permalink
Only error check on path existence if copyFile is true or path is abs…
Browse files Browse the repository at this point in the history
…olute.
  • Loading branch information
joseph-robertson committed May 9, 2023
1 parent 014991a commit 76c8024
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/model/ExternalFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,17 @@ namespace model {

// we expect all strings to be UTF-8 encoded
path p = toPath(filename);
if (!exists(p)) {
boost::optional<path> op = workflow.findFile(filename);
if (!op) {
this->remove();
LOG_AND_THROW("Cannot find file \"" << filename << "\" for " << this->briefDescription());
if (copyFile || !p.is_relative()) {
if (!exists(p)) {
boost::optional<path> op = workflow.findFile(filename);
if (!op) {
this->remove();
LOG_AND_THROW("Cannot find file \"" << filename << "\" for " << this->briefDescription());
}
p = op.get();
}
p = op.get();
OS_ASSERT(exists(p));
}
OS_ASSERT(exists(p));

bool ok;
if (copyFile) {
Expand Down

0 comments on commit 76c8024

Please sign in to comment.