aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server/src
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2022-03-17 11:40:09 +0100
committerGitHub <noreply@github.com>2022-03-17 11:40:09 +0100
commitb0276dfd74472df67c8e9d521d61fab4e47d26ad (patch)
tree178ffaacdbde37976bda6c45332a756077a31da9 /zellij-server/src
parentchore(version): bump development version (diff)
downloadsl0ppij-b0276dfd74472df67c8e9d521d61fab4e47d26ad.tar.gz
sl0ppij-b0276dfd74472df67c8e9d521d61fab4e47d26ad.tar.xz
sl0ppij-b0276dfd74472df67c8e9d521d61fab4e47d26ad.zip
fix(feat): `disable_automatic_asset_installation` (#1226)
* fix(feat): `disable_automatic_asset_installation` This fixes a regression in the feature system: The asset installation didn't get turned off by the feature. Add error logging to the install functions. Properly show features in setup disable `mkdir` in `wasm_vm` on `feature-disable-asset-installation` Alternative: Is this even needed? We make sure the directory is there upon the normal asset installation. fixes #1130
Diffstat (limited to 'zellij-server/src')
-rw-r--r--zellij-server/src/wasm_vm.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/zellij-server/src/wasm_vm.rs b/zellij-server/src/wasm_vm.rs
index ebea0b8c..4e29d323 100644
--- a/zellij-server/src/wasm_vm.rs
+++ b/zellij-server/src/wasm_vm.rs
@@ -92,7 +92,9 @@ pub(crate) fn wasm_thread_main(
let mut connected_clients: Vec<ClientId> = vec![];
let plugin_dir = data_dir.join("plugins/");
let plugin_global_data_dir = plugin_dir.join("data");
- fs::create_dir_all(&plugin_global_data_dir).unwrap();
+
+ #[cfg(not(feature = "disable_automatic_asset_installation"))]
+ fs::create_dir_all(&plugin_global_data_dir).unwrap_or_else(|e| log::error!("{:?}", e));
loop {
let (event, mut err_ctx) = bus.recv().expect("failed to receive event on channel");
@@ -270,7 +272,13 @@ fn start_plugin(
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());
- fs::create_dir_all(&plugin_own_data_dir).unwrap();
+ fs::create_dir_all(&plugin_own_data_dir).unwrap_or_else(|e| {
+ log::error!(
+ "Could not create plugin_own_data_dir in {:?} \n Error: {:?}",
+ &plugin_own_data_dir,
+ e
+ )
+ });
let mut wasi_env = WasiState::new("Zellij")
.env("CLICOLOR_FORCE", "1")