| 124 | while ((pos = text.find(from, pos)) != std::string::npos) { |
| 125 | text.replace(pos, from.size(), to); |
| 126 | pos += to.size(); |
| 127 | } |
| 128 | return text; |
| 129 | } |
| 130 | |
| 131 | std::string expand_value(std::string value, const WorkflowContext & context) { |
| 132 | value = replace_all(value, "${out_dir}", context.output_dir.string()); |
| 133 | value = replace_all(value, "${workflow_dir}", context.workflow_dir.string()); |
| 134 | for (const auto & [key, item] : context.values) { |
| 135 | value = replace_all(value, "${" + key + "}", item); |
| 136 | } |
no test coverage detected