mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-02-02 22:07:13 +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");
|
detail::infobox_widget("\nMount Successful!\n");
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||||
}
|
}
|
||||||
// TODO: reimplement natively
|
|
||||||
const auto& str = utils::make_multiline(partitions);
|
// remove current mount from all partitions list
|
||||||
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);
|
std::erase_if(partitions, [partition](std::string_view x) { return x.find(partition) != std::string_view::npos; });
|
||||||
const auto& res_text = utils::exec(cmd);
|
|
||||||
partitions = utils::make_multiline(res_text);
|
|
||||||
number_partitions -= 1;
|
number_partitions -= 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -746,7 +746,7 @@ void bios_bootloader() {
|
|||||||
if (selected_bootloader.empty()) { return; }
|
if (selected_bootloader.empty()) { return; }
|
||||||
/* clang-format on */
|
/* 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 */
|
/* clang-format off */
|
||||||
if (!tui::select_device()) { return; }
|
if (!tui::select_device()) { return; }
|
||||||
@ -1224,12 +1224,8 @@ void make_swap() noexcept {
|
|||||||
utils::exec(fmt::format(FMT_COMPILE("swapon {} &>/dev/null"), partition));
|
utils::exec(fmt::format(FMT_COMPILE("swapon {} &>/dev/null"), partition));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: reimplement natively
|
|
||||||
// Since a partition was used, remove that partition from the list
|
// Since a partition was used, remove that partition from the list
|
||||||
const auto& str = utils::make_multiline(partitions);
|
std::erase_if(partitions, [partition](std::string_view x) { return x.find(partition) != std::string_view::npos; });
|
||||||
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);
|
|
||||||
number_partitions -= 1;
|
number_partitions -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user