From 1d46a86a9366116e7d2f0c326f5035aad620d5a0 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Thu, 17 Mar 2022 10:25:15 +0100 Subject: [PATCH] fixup! Use `cache_directory` for plugin hashes Use `cache_directory` rather than the `plugin_directory` for plugin hashes. --- zellij-server/src/wasm_vm.rs | 5 ++--- zellij-utils/src/consts.rs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zellij-server/src/wasm_vm.rs b/zellij-server/src/wasm_vm.rs index d4796a3a71..9c63e3bf66 100644 --- a/zellij-server/src/wasm_vm.rs +++ b/zellij-server/src/wasm_vm.rs @@ -29,7 +29,7 @@ use crate::{ }; use zellij_utils::{ - consts::{VERSION, ZELLIJ_PROJ_DIR, ZELLIJ_TMP_DIR}, + consts::{VERSION, ZELLIJ_CACHE_DIR, ZELLIJ_PROJ_DIR, ZELLIJ_TMP_DIR}, errors::{ContextType, PluginContext}, }; use zellij_utils::{ @@ -271,8 +271,7 @@ fn start_plugin( let output = Pipe::new(); let input = Pipe::new(); let stderr = LoggingPipe::new(&plugin.location.to_string(), plugin_id); - let plugin_own_data_dir = plugin_global_data_dir.join(Url::from(&plugin.location).to_string()); - #[cfg(not(feature = "disable_automatic_asset_installation"))] + let plugin_own_data_dir = ZELLIJ_CACHE_DIR.join(Url::from(&plugin.location).to_string()); fs::create_dir_all(&plugin_own_data_dir).unwrap_or_else(|e| { log::error!( "Could not create plugin_own_data_dir in {:?} \n Error: {:?}", diff --git a/zellij-utils/src/consts.rs b/zellij-utils/src/consts.rs index 494d12a20e..cd3180023f 100644 --- a/zellij-utils/src/consts.rs +++ b/zellij-utils/src/consts.rs @@ -53,6 +53,7 @@ lazy_static! { pub static ref ZELLIJ_TMP_DIR: PathBuf = PathBuf::from(format!("/tmp/zellij-{}", *UID)); pub static ref ZELLIJ_TMP_LOG_DIR: PathBuf = ZELLIJ_TMP_DIR.join("zellij-log"); pub static ref ZELLIJ_TMP_LOG_FILE: PathBuf = ZELLIJ_TMP_LOG_DIR.join("zellij.log"); + pub static ref ZELLIJ_CACHE_DIR: PathBuf = ZELLIJ_PROJ_DIR.cache_dir().to_path_buf(); } pub const FEATURES: &[&str] = &[