Skip to content

Commit

Permalink
When loading from a string that is actually a path, call setOswPath
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Nov 7, 2024
1 parent 290661b commit 4aafb5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utilities/filetypes/WorkflowJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ namespace detail {
std::string formattedErrors;
bool parsingSuccessful = Json::parseFromStream(rbuilder, ss, &m_value, &formattedErrors);

openstudio::path p;

if (!parsingSuccessful) {

// see if this is a path
openstudio::path p = toPath(s);
p = toPath(s);
if (boost::filesystem::exists(p) && boost::filesystem::is_regular_file(p)) {
// open file
std::ifstream ifs(openstudio::toSystemFilename(p));
Expand All @@ -65,6 +67,10 @@ namespace detail {

parseSteps();
parseRunOptions();

if (!p.empty()) {
setOswPath(p, false);
}
}

WorkflowJSON_Impl::WorkflowJSON_Impl(const openstudio::path& p) {
Expand Down

0 comments on commit 4aafb5a

Please sign in to comment.