mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
👷 gucc: accept char as delim in utils::join instead of string_view
This commit is contained in:
parent
e2a39f2a8b
commit
809786d547
@ -35,7 +35,7 @@ auto make_multiline(const std::vector<std::string>& multiline, bool reverse = fa
|
||||
/// @param lines The lines to join.
|
||||
/// @param delim The delimiter to join the lines.
|
||||
/// @return The joined lines as a single string.
|
||||
auto join(const std::vector<std::string>& lines, std::string_view delim = "\n") noexcept -> std::string;
|
||||
auto join(const std::vector<std::string>& lines, char delim = '\n') noexcept -> std::string;
|
||||
|
||||
/// @brief Make a split view from a string into multiple lines based on a delimiter.
|
||||
/// @param str The string to split.
|
||||
|
@ -35,7 +35,7 @@ auto make_multiline(const std::vector<std::string>& multiline, bool reverse, std
|
||||
return res;
|
||||
}
|
||||
|
||||
auto join(const std::vector<std::string>& lines, std::string_view delim) noexcept -> std::string {
|
||||
auto join(const std::vector<std::string>& lines, char delim) noexcept -> std::string {
|
||||
return lines | std::ranges::views::join_with(delim) | std::ranges::to<std::string>();
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ auto create_new_user(const user::UserInfo& user_info, const std::vector<std::str
|
||||
|
||||
// Set user groups
|
||||
spdlog::info("Setting groups for user {}", user_info.username);
|
||||
const auto& groups_set_cmd = fmt::format(FMT_COMPILE("usermod -aG {} {}"), utils::join(default_groups, ","), user_info.username);
|
||||
const auto& groups_set_cmd = fmt::format(FMT_COMPILE("usermod -aG {} {}"), utils::join(default_groups, ','), user_info.username);
|
||||
if (!utils::arch_chroot_checked(groups_set_cmd, mountpoint)) {
|
||||
spdlog::error("Failed to set user groups with {}", groups_set_cmd);
|
||||
return false;
|
||||
|
@ -810,7 +810,7 @@ void install_base(const std::string_view& packages) noexcept {
|
||||
spdlog::error("Failed to install base");
|
||||
return;
|
||||
}
|
||||
const auto& base_pkgs = gucc::utils::join(*pkg_list, " ");
|
||||
const auto& base_pkgs = gucc::utils::join(*pkg_list, ' ');
|
||||
|
||||
spdlog::info("Preparing for pkgs to install: '{}'", base_pkgs);
|
||||
|
||||
@ -908,7 +908,7 @@ void install_desktop(const std::string_view& desktop) noexcept {
|
||||
spdlog::error("Failed to install desktop");
|
||||
return;
|
||||
}
|
||||
const auto& packages = gucc::utils::join(*pkg_list, " ");
|
||||
const auto& packages = gucc::utils::join(*pkg_list, ' ');
|
||||
|
||||
spdlog::info("Preparing for desktop envs to install: '{}'", packages);
|
||||
utils::install_from_pkglist(packages);
|
||||
|
Loading…
Reference in New Issue
Block a user