减小打包体积
This commit is contained in:
@@ -81,8 +81,20 @@ std::string form_value(const std::string& body, const std::string& key) {
|
||||
}
|
||||
|
||||
std::string sanitize_process_error(std::string output) {
|
||||
output = std::regex_replace(output, std::regex(R"(^Licensed to:.*$)", std::regex::icase | std::regex::multiline), "Spine 授权信息已隐藏");
|
||||
return trim(output);
|
||||
// 逐行替换,避免依赖 std::regex::multiline(MSVC 的 <regex> 未实现该标志)。
|
||||
const std::regex licensed(R"(^Licensed to:.*$)", std::regex::icase);
|
||||
std::string result;
|
||||
std::size_t start = 0;
|
||||
while (start <= output.size()) {
|
||||
const auto end = output.find('\n', start);
|
||||
std::string line = output.substr(start, end - start);
|
||||
if (!line.empty() && line.back() == '\r') line.pop_back();
|
||||
result += std::regex_replace(line, licensed, "Spine 授权信息已隐藏");
|
||||
if (end == std::string::npos) break;
|
||||
result += '\n';
|
||||
start = end + 1;
|
||||
}
|
||||
return trim(result);
|
||||
}
|
||||
|
||||
std::pair<std::vector<std::uint8_t>, std::string> convert(const Json& payload, const std::string& executable) {
|
||||
|
||||
Reference in New Issue
Block a user