Skip to content

Commit

Permalink
fixup! Use cache_directory for plugin hashes
Browse files Browse the repository at this point in the history
Use `cache_directory` rather than the `plugin_directory`
for plugin hashes.
  • Loading branch information
a-kenji committed Mar 17, 2022
1 parent 3506ca5 commit be35cf5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions update-toolchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euxo pipefail

get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":'
#| # Get tag line
#sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}

get_latest_release "$1"
5 changes: 2 additions & 3 deletions zellij-server/src/wasm_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::{
};

use zellij_utils::{
consts::{VERSION, ZELLIJ_PROJ_DIR, ZELLIJ_TMP_DIR},
consts::{VERSION, ZELLIJ_PROJ_DIR, ZELLIJ_TMP_DIR, ZELLIJ_CACHE_DIR},
errors::{ContextType, PluginContext},
};
use zellij_utils::{
Expand Down Expand Up @@ -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: {:?}",
Expand Down
1 change: 1 addition & 0 deletions zellij-utils/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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] = &[
Expand Down

0 comments on commit be35cf5

Please sign in to comment.