Skip to content

Commit

Permalink
fix: update to output error when using --layout (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeheonji authored May 12, 2022
1 parent f04e5bd commit 8c38b39
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions zellij-utils/src/input/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,14 @@ impl LayoutFromYamlIntermediate {
layout_dir: Option<&PathBuf>,
) -> LayoutFromYamlIntermediateResult {
match layout_dir {
Some(dir) => Self::from_path(&dir.join(layout))
.or_else(|_| LayoutFromYamlIntermediate::from_default_assets(layout)),
Some(dir) => {
let layout_path = &dir.join(layout);
if layout_path.exists() {
Self::from_path(layout_path)
} else {
LayoutFromYamlIntermediate::from_default_assets(layout)
}
}
None => LayoutFromYamlIntermediate::from_default_assets(layout),
}
}
Expand Down

0 comments on commit 8c38b39

Please sign in to comment.