👷 do not suppress return code of system function

This commit is contained in:
Vladislav Nepogodin 2021-12-05 16:27:51 +04:00
parent e058ea6936
commit 0ead58d906
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9

View File

@ -80,8 +80,8 @@ void exec(const std::vector<std::string>& vec) noexcept {
// https://github.com/hniksic/rust-subprocess
std::string exec(const std::string_view& command, const bool& interactive) noexcept {
if (interactive) {
system(command.data());
return {};
const auto& ret_code = system(command.data());
return std::to_string(ret_code);
}
auto* pipe = popen(command.data(), "r");