mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-02-02 22:07:13 +08:00
🧹 simple_tui: refactor to use utils::exec_checked
This commit is contained in:
parent
f457a1c557
commit
616299ece4
@ -131,8 +131,8 @@ void make_esp(const std::string& part_name, std::string_view bootloader_name, bo
|
|||||||
config_data["UEFI_PART"] = partition;
|
config_data["UEFI_PART"] = partition;
|
||||||
|
|
||||||
// If it is already a fat/vfat partition...
|
// If it is already a fat/vfat partition...
|
||||||
const auto& ret_status = gucc::utils::exec(fmt::format(FMT_COMPILE("fsck -N {} | grep fat &>/dev/null"), partition), true);
|
const auto& is_fat_part = gucc::utils::exec_checked(fmt::format(FMT_COMPILE("fsck -N {} | grep -q fat"), partition));
|
||||||
if (ret_status != "0" && reformat_part) {
|
if (!is_fat_part && reformat_part) {
|
||||||
#ifdef NDEVENV
|
#ifdef NDEVENV
|
||||||
gucc::utils::exec(fmt::format(FMT_COMPILE("mkfs.vfat -F32 {} &>/dev/null"), partition));
|
gucc::utils::exec(fmt::format(FMT_COMPILE("mkfs.vfat -F32 {} &>/dev/null"), partition));
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user