added iso gui option

This commit is contained in:
JMARyA 2024-12-28 03:37:15 +01:00
parent e794bef718
commit 5c4945de60
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 39 additions and 6 deletions

View file

@ -54,6 +54,25 @@ pub fn uncomment_first_value_of(value: &str, file: &str) {
std::fs::write(file, new).unwrap();
}
pub fn uncomment_tag(tag: &str, file: &str) {
// read in the file
let content = std::fs::read_to_string(file).unwrap();
let mut new = String::new();
// search for the first instance of `value` in the file
// uncomment the '#' symbol if there is one
for line in content.lines() {
if line.starts_with(tag) {
new.push_str(&format!("{}\n", line.trim_start_matches(tag)));
} else {
new.push_str(&format!("{line}\n"));
}
}
// write back
std::fs::write(file, new).unwrap();
}
pub fn install(conf: InstallConfig) {
// Drive Setup
format_drives(&conf.drive, conf.general.encryption);