add installer kb options
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
JMARyA 2024-12-29 11:43:52 +01:00
parent db1acbbd3c
commit 6b3314d032
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
5 changed files with 37 additions and 5 deletions

View file

@ -82,7 +82,10 @@ fn main() {
match args.subcommand() {
Some(("create-iso", iso_args)) => {
let without_gui = iso_args.get_flag("without_gui");
create_iso(without_gui);
let kb_layout_default = "en".to_string();
let kb_layout: &String = iso_args.get_one("LAYOUT").unwrap_or(&kb_layout_default);
let kb_variant: Option<&str> = iso_args.get_one("LAYOUT").map(|x: &String| x.as_str());
create_iso(without_gui, &kb_layout, kb_variant);
std::process::exit(0);
}
Some(("create-tar", _)) => {
@ -115,6 +118,11 @@ fn main() {
unimplemented!()
}
Some(("install", install_args)) => {
if !is_root() {
eprintln!("Error: You need root to install");
std::process::exit(1);
}
let config_file: &String = install_args.get_one("config").unwrap();
let config_content = std::fs::read_to_string(config_file);