flesh out todo list, better configure code

Signed-off-by: Ava Hahn <ava@aidanis.online>
This commit is contained in:
Ava Hahn 2023-01-21 16:12:21 -08:00
parent d296eb4510
commit e7dd0caa4a
Signed by untrusted user who does not match committer: affine
GPG key ID: 3A4645B8CF806069
4 changed files with 64 additions and 26 deletions

View file

@ -47,12 +47,24 @@ fn main() {
}
let vt = Rc::new(RefCell::new(VTable::new()));
// if we fail to get stdlib we can just use this one
let mut ft = Rc::new(RefCell::new(FTable::new()));
let conf_file;
let mut ft;
match env::var("RELISH_CFG_FILE") {
Ok(s) => configure(s, vt.clone(), ft.clone()),
Err(_) => configure(cfg, vt.clone(), ft.clone()),
Ok(s) => {
conf_file = s
},
Err(e) => {
eprintln!("{}", e);
conf_file = cfg;
},
}
match configure(conf_file, vt.clone()) {
Ok(f) => ft = f,
Err(e) => {
ft = Rc::new(RefCell::new(FTable::new()));
eprintln!("{}", e);
},
}
match get_stdlib(vt.clone()) {