From b746cdbe8ce01ae3da5dbd7d6621c1d38d586643 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Sun, 24 Jul 2022 12:06:20 +0300 Subject: [PATCH] fix unic cmd --- src/utils/utils.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index d2e489f..b8f4852 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -46,16 +46,14 @@ namespace hack::utils } } - inline std::string exec(const std::string& cmd) + inline std::string unix_cmd(const std::string& cmd) { std::string result; - std::array buffer; + std::array buffer; std::unique_ptr pipe(popen(cmd.c_str(), "r"), pclose); if (!pipe) - { throw std::runtime_error("bash cmd failed"); - } while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {