mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
🚧 update mounting step
This commit is contained in:
parent
4a472d7954
commit
0ed5f1cc81
11
src/misc.cpp
11
src/misc.cpp
@ -20,10 +20,10 @@ namespace fs = std::filesystem;
|
||||
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 confirm_mount([[maybe_unused]] const std::string_view& part_user, bool quite) {
|
||||
#ifdef NDEVENV
|
||||
const auto& ret_status = utils::exec(fmt::format(FMT_COMPILE("mount | grep {}"), part_user), true);
|
||||
if (ret_status != "0") {
|
||||
if (!quite && (ret_status != "0")) {
|
||||
detail::infobox_widget("\nMount Failed!\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
return false;
|
||||
@ -35,9 +35,10 @@ bool confirm_mount([[maybe_unused]] const std::string_view& part_user) {
|
||||
auto& partitions = std::get<std::vector<std::string>>(config_data["PARTITIONS"]);
|
||||
auto& number_partitions = std::get<std::int32_t>(config_data["NUMBER_PARTITIONS"]);
|
||||
|
||||
detail::infobox_widget("\nMount Successful!\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
|
||||
if (!quite) {
|
||||
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);
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <string_view> // for string_view
|
||||
|
||||
namespace tui {
|
||||
bool confirm_mount([[maybe_unused]] const std::string_view& part_user);
|
||||
bool confirm_mount([[maybe_unused]] const std::string_view& part_user, bool quite = false);
|
||||
void set_fsck_hook() noexcept;
|
||||
void set_cache() noexcept;
|
||||
void edit_configs() noexcept;
|
||||
|
@ -1099,7 +1099,7 @@ bool mount_current_partition(bool force) noexcept {
|
||||
#endif
|
||||
|
||||
/* clang-format off */
|
||||
if (!force) { confirm_mount(fmt::format(FMT_COMPILE("{}{}"), mountpoint, mount_dev)); }
|
||||
confirm_mount(fmt::format(FMT_COMPILE("{}{}"), mountpoint, mount_dev), force);
|
||||
/* clang-format on */
|
||||
|
||||
// Identify if mounted partition is type "crypt" (LUKS on LVM, or LUKS alone)
|
||||
|
Loading…
Reference in New Issue
Block a user