diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-04-14 19:08:22 +0100 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-04-14 19:08:22 +0100 |
| commit | af702b67e69981c00cf022888164fbd7b278f7e5 (patch) | |
| tree | e076817e404defb636255f0860f968c29613c137 /src/client | |
| parent | feat(build): allow arguments to be passed to Zellij (diff) | |
| download | sl0ppij-af702b67e69981c00cf022888164fbd7b278f7e5.tar.gz sl0ppij-af702b67e69981c00cf022888164fbd7b278f7e5.tar.xz sl0ppij-af702b67e69981c00cf022888164fbd7b278f7e5.zip | |
feat(build): vastly simplify the build system
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/layout.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/layout.rs b/src/client/layout.rs index 2524f894..e82f9045 100644 --- a/src/client/layout.rs +++ b/src/client/layout.rs @@ -1,6 +1,5 @@ -use directories_next::ProjectDirs; use serde::{Deserialize, Serialize}; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::{fs::File, io::prelude::*}; use crate::panes::PositionAndSize; @@ -180,11 +179,9 @@ pub struct Layout { } impl Layout { - pub fn new(layout_path: PathBuf) -> Self { - let project_dirs = ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap(); - let layout_dir = project_dirs.data_dir().join("layouts/"); + pub fn new(layout_path: &Path, data_dir: &Path) -> Self { + let layout_dir = data_dir.join("layouts/"); let mut layout_file = File::open(&layout_path) - .or_else(|_| File::open(&layout_path.with_extension("yaml"))) .or_else(|_| File::open(&layout_dir.join(&layout_path).with_extension("yaml"))) .unwrap_or_else(|_| panic!("cannot find layout {}", &layout_path.display())); |
