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 // get config
let mut config = Config::get_default(); let mut config = Config::get_default();
for k in parsed_config.keys() { if let Some(v) = parsed_config.get("config") {
if let Value::Table(t) = parsed_config.get(k).unwrap() { if let Value::Table(t) = v {
if k == "config" {
config.set(&t); config.set(&t);
break; } 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: 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 pool = console
build {output_file}: regen_ninjafile {config_file_name} || $builddir/compile_commands.json build {output_file}: regen_ninjafile {config_file_name} || $builddir/compile_commands.json