| 79 | } |
| 80 | |
| 81 | std::optional<int> InvokeApp::sdk() |
| 82 | { |
| 83 | LogFunc; |
| 84 | |
| 85 | auto argv_opt = sdk_argv_.gen(argv_replace_); |
| 86 | if (!argv_opt) { |
| 87 | return std::nullopt; |
| 88 | } |
| 89 | |
| 90 | auto output_opt = startup_and_read_pipe(*argv_opt); |
| 91 | if (!output_opt) { |
| 92 | return std::nullopt; |
| 93 | } |
| 94 | |
| 95 | std::string& ret = *output_opt; |
| 96 | string_trim_(ret); |
| 97 | |
| 98 | if (!std::ranges::all_of(ret, [](unsigned char c) { return std::isdigit(c); })) { |
| 99 | return std::nullopt; |
| 100 | } |
| 101 | return std::stoi(ret); |
| 102 | } |
| 103 | |
| 104 | bool InvokeApp::push(const std::filesystem::path& path) |
| 105 | { |