mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-02-02 22:07:13 +08:00
🚧 add post-install script to simple_view
This commit is contained in:
parent
431c1a8599
commit
5fe175b1ea
@ -15,8 +15,9 @@ bool Config::initialize() noexcept {
|
||||
}
|
||||
s_config = std::make_unique<Config>();
|
||||
if (s_config) {
|
||||
s_config->m_data["hostcache"] = static_cast<std::int32_t>(!fs::exists("/run/miso/bootmnt"));
|
||||
s_config->m_data["menus"] = -1;
|
||||
s_config->m_data["hostcache"] = static_cast<std::int32_t>(!fs::exists("/run/miso/bootmnt"));
|
||||
s_config->m_data["menus"] = -1;
|
||||
s_config->m_data["POST_INSTALL"] = "";
|
||||
|
||||
s_config->m_data["H_INIT"] = "openrc";
|
||||
s_config->m_data["SYSTEM"] = "BIOS";
|
||||
|
@ -114,6 +114,7 @@ void menu_simple() noexcept {
|
||||
const auto& desktop = std::get<std::string>(config_data["DE"]);
|
||||
const auto& bootloader = std::get<std::string>(config_data["BOOTLOADER"]);
|
||||
const auto& drivers_type = std::get<std::string>(config_data["DRIVERS_TYPE"]);
|
||||
const auto& post_install = std::get<std::string>(config_data["POST_INSTALL"]);
|
||||
|
||||
if (device_info.empty()) {
|
||||
tui::select_device();
|
||||
@ -260,6 +261,13 @@ void menu_simple() noexcept {
|
||||
std::ofstream{fmt::format(FMT_COMPILE("{}/.video_installed"), mountpoint)};
|
||||
#endif
|
||||
|
||||
if (!post_install.empty()) {
|
||||
spdlog::info("Running post-install script...");
|
||||
#ifdef NDEVENV
|
||||
utils::exec(fmt::format("{} &>>/tmp/cachyos-install.log", post_install), true);
|
||||
#endif
|
||||
}
|
||||
|
||||
tui::exit_done();
|
||||
|
||||
fmt::print("┌{0:─^{5}}┐\n"
|
||||
|
@ -1635,6 +1635,11 @@ void parse_config() noexcept {
|
||||
}
|
||||
|
||||
config_data["DRIVERS_TYPE"] = drivers_type;
|
||||
|
||||
if (doc.HasMember("post_install")) {
|
||||
assert(doc["post_install"].IsString());
|
||||
config_data["POST_INSTALL"] = std::string{doc["post_install"].GetString()};
|
||||
}
|
||||
}
|
||||
|
||||
void setup_luks_keyfile() noexcept {
|
||||
|
Loading…
Reference in New Issue
Block a user