| 142 | } |
| 143 | |
| 144 | bool InvokeApp::remove() |
| 145 | { |
| 146 | LogFunc; |
| 147 | |
| 148 | if (!pushed_) { |
| 149 | LogDebug << "Not pushed, skip remove"; |
| 150 | return true; |
| 151 | } |
| 152 | if (tempname_.empty()) { |
| 153 | LogWarn << "tempname_ is empty"; |
| 154 | return false; |
| 155 | } |
| 156 | |
| 157 | merge_replacement({ { "{TO_REMOVED_FILE}", tempname_ } }); |
| 158 | |
| 159 | auto argv_opt = remove_file_argv_.gen(argv_replace_); |
| 160 | if (!argv_opt) { |
| 161 | return false; |
| 162 | } |
| 163 | |
| 164 | auto output_opt = startup_and_read_pipe(*argv_opt); |
| 165 | if (!output_opt) { |
| 166 | return false; |
| 167 | } |
| 168 | |
| 169 | pushed_ = false; |
| 170 | return true; |
| 171 | } |
| 172 | |
| 173 | std::optional<std::string> InvokeApp::invoke_bin_and_read_pipe(const std::string& extra) |
| 174 | { |
no test coverage detected