aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorBrooks Rady <b.j.rady@gmail.com>2021-04-14 19:36:11 +0100
committerGitHub <noreply@github.com>2021-04-14 19:36:11 +0100
commit126a4b1d33502b6e371cca4101dbb7a0c7fe28bc (patch)
tree907c865bc81d907077bb0c2ce7bf7d81f4b08c92 /src/client
parentfix(compatibility): bash reverse search (#271) (diff)
parentfix(build): tweak the publishing process (diff)
downloadsl0ppij-126a4b1d33502b6e371cca4101dbb7a0c7fe28bc.tar.gz
sl0ppij-126a4b1d33502b6e371cca4101dbb7a0c7fe28bc.tar.xz
sl0ppij-126a4b1d33502b6e371cca4101dbb7a0c7fe28bc.zip
feat(build): overhaul build system
Diffstat (limited to 'src/client')
-rw-r--r--src/client/layout.rs9
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()));