fix docs, and init stdlib when configuring
This commit is contained in:
parent
1b1ac3cd2b
commit
827458b06f
4 changed files with 16 additions and 7 deletions
|
|
@ -28,14 +28,16 @@ use relish::stdlib::{get_stdlib};
|
|||
fn main() {
|
||||
let mut rl = Editor::<()>::new();
|
||||
|
||||
const HIST_FILE: &str = ".relish_hist";
|
||||
const CONFIG_FILE_DEFAULT: &str = ".relishrc";
|
||||
const HIST_FILE: &str = "/.relish_hist";
|
||||
const CONFIG_FILE_DEFAULT: &str = "/.relishrc";
|
||||
|
||||
let mut hist: String = "".to_owned();
|
||||
let mut cfg: String = "".to_owned();
|
||||
|
||||
if let Some(home) = home_dir() {
|
||||
if let Some(h) = home.to_str() {
|
||||
hist = h.to_owned() + HIST_FILE;
|
||||
cfg = h.to_owned() + CONFIG_FILE_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +52,7 @@ fn main() {
|
|||
|
||||
match env::var("RELISH_CFG_FILE") {
|
||||
Ok(s) => configure(s, vt.clone(), ft.clone()),
|
||||
Err(_) => configure(String::from(CONFIG_FILE_DEFAULT), vt.clone(), ft.clone())
|
||||
Err(_) => configure(cfg, vt.clone(), ft.clone())
|
||||
}
|
||||
|
||||
match get_stdlib(vt.clone()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue