Skip to content

Commit

Permalink
refactor(languages_errors): better approach to the languages directory
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vitor-sr authored and max-niederman committed Sep 29, 2023
1 parent cb73e39 commit 4e680a0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,13 @@ fn main() -> crossterm::Result<()> {
}

if opt.list_languages {
opt.languages()
.expect("Couldn't get installed languages under the config directory. Make sure the config and language directory exist.")
match opt.languages() {
Ok(languages) => languages,
Err(_) => {
println!("Warning: Couldn't get installed languages under config directory. Make sure the config directory exists.");
vec![]
}
}
.iter()
.for_each(|name| println!("{}", name.to_str().expect("Ill-formatted language name.")));
return Ok(());
Expand Down

0 comments on commit 4e680a0

Please sign in to comment.