v0.1.1
This commit is contained in:
parent
7945e48b79
commit
17f7a9df7b
16
src/main.rs
16
src/main.rs
@ -32,18 +32,6 @@ impl Project {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
/*
|
|
||||||
let default = String::from("en_US"); // default locale
|
|
||||||
let locales = rust_i18n::available_locales!(); // available locales
|
|
||||||
let lang:String = match env::var("LANG") { // find out user's lang
|
|
||||||
Ok(val) => match val {
|
|
||||||
v if !v.is_empty() && locales.iter().any(|e| v.contains(e)) => v[..5].to_string(),
|
|
||||||
_ => default
|
|
||||||
} ,
|
|
||||||
Err(..) => default,
|
|
||||||
};
|
|
||||||
rust_i18n::set_locale(&lang); // set user lang
|
|
||||||
*/
|
|
||||||
let _ = set_lang();
|
let _ = set_lang();
|
||||||
let mut wiki_path = String::new();
|
let mut wiki_path = String::new();
|
||||||
let mut doc_path = String::new();
|
let mut doc_path = String::new();
|
||||||
@ -69,14 +57,12 @@ fn main() {
|
|||||||
|
|
||||||
if !Path::new(&wiki_path).exists(){
|
if !Path::new(&wiki_path).exists(){
|
||||||
let mut ans = String::new();
|
let mut ans = String::new();
|
||||||
//println!("{} dokumentuentzako kokapen berria sortu nahi duzu?(y/n)[Y]", &project_dir.trim().to_owned().green().bold());
|
|
||||||
println!("{}", t!("Do you want to create a new location called %{s} for the documents?(y/n)[Y]", s = &project_dir.trim().to_owned().green().bold()));
|
println!("{}", t!("Do you want to create a new location called %{s} for the documents?(y/n)[Y]", s = &project_dir.trim().to_owned().green().bold()));
|
||||||
io::stdin().read_line(&mut ans).expect("Failed to read line");
|
io::stdin().read_line(&mut ans).expect("Failed to read line");
|
||||||
if ans.trim().is_empty() { ans = String::from("Y") };
|
if ans.trim().is_empty() { ans = String::from("Y") };
|
||||||
match ans.trim() {
|
match ans.trim() {
|
||||||
"y" | "yes" | "Y" | "B" | "Bai" => { //let _ = fs::create_dir(&wiki_path);
|
"y" | "yes" | "Y" | "B" | "Bai" => { //let _ = fs::create_dir(&wiki_path);
|
||||||
let _ = mkdir(&wiki_path);
|
let _ = mkdir(&wiki_path);
|
||||||
//println!("{} kokapena sortu da.", &project_dir.trim().to_owned().green().bold());
|
|
||||||
println!("{}.", t!("Location %{s} has been created", s = &project_dir.trim().to_owned().green().bold()));
|
println!("{}.", t!("Location %{s} has been created", s = &project_dir.trim().to_owned().green().bold()));
|
||||||
},
|
},
|
||||||
_ => continue,
|
_ => continue,
|
||||||
@ -137,8 +123,6 @@ fn main() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//println!("{} proiektua sortu da. Orain index.md fitxategia editatu eta edukiak \
|
|
||||||
// sor ditzakezu", &input.trim().to_owned().green().bold());
|
|
||||||
println!("{}.", t!("Project %{s} has been created. Now you can edit index.md file and create content", s = &input.trim().to_owned().green().bold()));
|
println!("{}.", t!("Project %{s} has been created. Now you can edit index.md file and create content", s = &input.trim().to_owned().green().bold()));
|
||||||
},
|
},
|
||||||
_ => continue,
|
_ => continue,
|
||||||
|
Loading…
Reference in New Issue
Block a user