fixed double-regen bug + removed unnecessary for

This commit is contained in:
Noah Swerhun 2024-03-07 15:03:31 -06:00
parent 1f0a940d95
commit abec4c2ba0

View file

@ -130,12 +130,11 @@ fn main() {
// get config
let mut config = Config::get_default();
for k in parsed_config.keys() {
if let Value::Table(t) = parsed_config.get(k).unwrap() {
if k == "config" {
config.set(&t);
break;
}
if let Some(v) = parsed_config.get("config") {
if let Value::Table(t) = v {
config.set(&t);
} else {
panic!("error parsing config table: config invalid type, must be a table.");
}
}
//----
@ -212,7 +211,7 @@ rule regen_compile_commands
build $builddir: mkdir
build $builddir/compile_commands.json: regen_compile_commands {config_file_name} | $builddir
build $builddir/compile_commands.json: regen_compile_commands {config_file_name} || $builddir
pool = console
build {output_file}: regen_ninjafile {config_file_name} || $builddir/compile_commands.json