🧹 misc: refactor to use utils::exec_checked

This commit is contained in:
Vladislav Nepogodin 2024-07-14 02:43:47 +04:00
parent 69ed4a5a8d
commit 1888d5a45d
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9

View File

@ -77,8 +77,8 @@ namespace tui {
// Revised to deal with partition sizes now being displayed to the user
bool confirm_mount([[maybe_unused]] const std::string_view& part_user, bool quite) {
#ifdef NDEVENV
const auto& ret_status = gucc::utils::exec(fmt::format(FMT_COMPILE("mount | grep -q {}"), part_user), true);
if (!quite && (ret_status != "0"sv)) {
const auto& is_mounted = gucc::utils::exec_checked(fmt::format(FMT_COMPILE("mount | grep -q {}"), part_user));
if (!quite && !is_mounted) {
detail::infobox_widget("\nMount Failed!\n"sv);
std::this_thread::sleep_for(std::chrono::seconds(2));
return false;