From 8c38b39ef6a03f8762ae54cdb47c72b09fab06c1 Mon Sep 17 00:00:00 2001 From: Jae-Heon Ji <32578710+jaeheonji@users.noreply.github.com> Date: Thu, 12 May 2022 22:42:31 +0900 Subject: [PATCH] fix: update to output error when using `--layout` (#1413) --- zellij-utils/src/input/layout.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs index 3289f77d..4e91bcdc 100644 --- a/zellij-utils/src/input/layout.rs +++ b/zellij-utils/src/input/layout.rs @@ -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), } }