mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
👷 implement smth natively
This commit is contained in:
parent
877e86d9b4
commit
f746a67be1
@ -39,11 +39,9 @@ bool confirm_mount([[maybe_unused]] const std::string_view& part_user, bool quit
|
||||
detail::infobox_widget("\nMount Successful!\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
}
|
||||
// TODO: reimplement natively
|
||||
const auto& str = utils::make_multiline(partitions);
|
||||
const auto& cmd = fmt::format(FMT_COMPILE("echo \"{0}\" | sed \"s~{1} [0-9]*[G-M]~~\" | sed \"s~{1} [0-9]*\\.[0-9]*[G-M]~~\" | sed s~{1}$' -'~~"), str, partition);
|
||||
const auto& res_text = utils::exec(cmd);
|
||||
partitions = utils::make_multiline(res_text);
|
||||
|
||||
// remove current mount from all partitions list
|
||||
std::erase_if(partitions, [partition](std::string_view x) { return x.find(partition) != std::string_view::npos; });
|
||||
number_partitions -= 1;
|
||||
return true;
|
||||
}
|
||||
|
@ -746,7 +746,7 @@ void bios_bootloader() {
|
||||
if (selected_bootloader.empty()) { return; }
|
||||
/* clang-format on */
|
||||
|
||||
selected_bootloader = utils::exec(fmt::format(FMT_COMPILE("echo \"{}\" | sed 's/+ \\|\"//g'"), selected_bootloader));
|
||||
utils::remove_all(selected_bootloader, "+ ");
|
||||
|
||||
/* clang-format off */
|
||||
if (!tui::select_device()) { return; }
|
||||
@ -1224,12 +1224,8 @@ void make_swap() noexcept {
|
||||
utils::exec(fmt::format(FMT_COMPILE("swapon {} &>/dev/null"), partition));
|
||||
#endif
|
||||
|
||||
// TODO: reimplement natively
|
||||
// Since a partition was used, remove that partition from the list
|
||||
const auto& str = utils::make_multiline(partitions);
|
||||
const auto& cmd = fmt::format(FMT_COMPILE("echo \"{0}\" | sed \"s~{1} [0-9]*[G-M]~~\" | sed \"s~{1} [0-9]*\\.[0-9]*[G-M]~~\" | sed s~{1}$' -'~~"), str, partition);
|
||||
const auto& res_text = utils::exec(cmd);
|
||||
partitions = utils::make_multiline(res_text);
|
||||
std::erase_if(partitions, [partition](std::string_view x) { return x.find(partition) != std::string_view::npos; });
|
||||
number_partitions -= 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user