summaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/consts.rs
diff options
context:
space:
mode:
authorJae-Heon Ji <32578710+jaeheonji@users.noreply.github.com>2023-06-20 05:57:39 +0900
committerGitHub <noreply@github.com>2023-06-20 05:57:39 +0900
commit9ed45357ff34599ab0c99142b944c00d0276df6e (patch)
tree77879b78da32ad56abfa47949a6a513f65551a07 /zellij-utils/src/consts.rs
parent294b87803f1b6a66c8ae559e736c69aa676f90b3 (diff)
hotfix: include theme files into binary (#2566)
* fix: include theme files into binary * fix: delete unused features * fix: change user theme dir to optional
Diffstat (limited to 'zellij-utils/src/consts.rs')
-rw-r--r--zellij-utils/src/consts.rs17
1 files changed, 3 insertions, 14 deletions
diff --git a/zellij-utils/src/consts.rs b/zellij-utils/src/consts.rs
index 047cf9862..50600a934 100644
--- a/zellij-utils/src/consts.rs
+++ b/zellij-utils/src/consts.rs
@@ -1,7 +1,7 @@
//! Zellij program-wide constants.
-use crate::input::theme::Themes;
use directories_next::ProjectDirs;
+use include_dir::{include_dir, Dir};
use lazy_static::lazy_static;
use once_cell::sync::OnceCell;
use std::path::PathBuf;
@@ -18,6 +18,8 @@ pub static DEBUG_MODE: OnceCell<bool> = OnceCell::new();
pub const SYSTEM_DEFAULT_CONFIG_DIR: &str = "/etc/zellij";
pub const SYSTEM_DEFAULT_DATA_DIR_PREFIX: &str = system_default_data_dir();
+pub static ZELLIJ_DEFAULT_THEMES: Dir = include_dir!("$CARGO_MANIFEST_DIR/assets/themes");
+
const fn system_default_data_dir() -> &'static str {
if let Some(data_dir) = std::option_env!("PREFIX") {
data_dir
@@ -34,19 +36,6 @@ lazy_static! {
.cache_dir()
.to_path_buf()
.join(format!("{}", Uuid::new_v4()));
- pub static ref ZELLIJ_DEFAULT_THEMES: Themes = {
- let mut default_themes = Themes::default();
-
- let path = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/themes"));
- match Themes::from_dir(path) {
- Ok(themes) => {
- default_themes = default_themes.merge(themes);
- },
- Err(_) => {},
- }
-
- default_themes
- };
}
pub const FEATURES: &[&str] = &[