Skip to content

Commit

Permalink
Fixes #3317
Browse files Browse the repository at this point in the history
  • Loading branch information
macumber committed Oct 18, 2018
1 parent 93cfd37 commit e8fd0b1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions openstudiocore/src/model/ExternalFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,19 @@ ExternalFile::ExternalFile(const Model& model, const std::string &filename)
}
OS_ASSERT(exists(p));

path rootDir = workflow.absoluteRootDir();
path dest = rootDir / p.filename();
path destDir;
std::vector<path> absoluteFilePaths = workflow.absoluteFilePaths();
if (absoluteFilePaths.empty()) {
destDir = workflow.absoluteRootDir();
} else {
destDir = absoluteFilePaths[0];
}
path dest = destDir / p.filename();

if (exists(dest)) {
if (checksum(p) != checksum(dest)){
this->remove();
LOG_AND_THROW("File \"" << p.filename() << "\" already exists in \"" << rootDir << "\"");
LOG_AND_THROW("File \"" << p.filename() << "\" already exists in \"" << destDir << "\"");
}
} else{

Expand Down

0 comments on commit e8fd0b1

Please sign in to comment.