Skip to content

Commit

Permalink
Use is_file instead of existence in finding .ozy.yaml
Browse files Browse the repository at this point in the history
Fixes an issue where if you have a magic filesystem on your cwd
(e.g. `envy` via autofs) which dreams up directories if you ask it
...then `ozy` used to:

```
Error: While loading ozy config

Caused by:
    0: Reading config YAML
    1: Is a directory (os error 21)
```
  • Loading branch information
mattgodbolt committed Sep 30, 2024
1 parent 6a2bba0 commit 3fc7cf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rozy/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn load_config(base_config_filename_override: Option<&str>) -> Result<Config
let ancestors: Vec<&std::path::Path> = curr_dir.ancestors().collect();
for dir in ancestors.iter().rev() {
let ozy_config_path = dir.join(".ozy.yaml");
if !ozy_config_path.exists() {
if !ozy_config_path.is_file() {
continue;
}

Expand Down

0 comments on commit 3fc7cf0

Please sign in to comment.