mirror of
https://github.com/denisidoro/navi
synced 2024-11-13 23:37:10 +00:00
Fix welcome command
This commit is contained in:
parent
4bfc2e5a6c
commit
a625b0aea0
1 changed files with 12 additions and 12 deletions
|
@ -227,18 +227,18 @@ pub fn read_all(
|
|||
let folders = paths_from_path_param(&paths);
|
||||
|
||||
for folder in folders {
|
||||
let dir_entries = fs::read_dir(folder).map_err(|e| UnreadableDir::new(folder, e))?;
|
||||
|
||||
for entry in dir_entries {
|
||||
let path = entry.map_err(|e| UnreadableDir::new(folder, e))?.path();
|
||||
let path_str = path
|
||||
.to_str()
|
||||
.ok_or_else(|| InvalidPath(path.to_path_buf()))?;
|
||||
if path_str.ends_with(".cheat")
|
||||
&& read_file(path_str, &mut variables, &mut visited_lines, stdin).is_ok()
|
||||
&& !found_something
|
||||
{
|
||||
found_something = true;
|
||||
if let Ok(dir_entries) = fs::read_dir(folder) {
|
||||
for entry in dir_entries {
|
||||
let path = entry.map_err(|e| UnreadableDir::new(folder, e))?.path();
|
||||
let path_str = path
|
||||
.to_str()
|
||||
.ok_or_else(|| InvalidPath(path.to_path_buf()))?;
|
||||
if path_str.ends_with(".cheat")
|
||||
&& read_file(path_str, &mut variables, &mut visited_lines, stdin).is_ok()
|
||||
&& !found_something
|
||||
{
|
||||
found_something = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue