diff options
| author | Thomas Linford <tlinford@users.noreply.github.com> | 2022-03-23 09:20:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-23 09:20:46 +0100 |
| commit | c4d62f8f617a2fad50133e1b7829c683429752b4 (patch) | |
| tree | f591733fa7a848994d00661338824a69f1a78202 | |
| parent | docs(changelog): termion ==> termwiz (diff) | |
| download | sl0ppij-c4d62f8f617a2fad50133e1b7829c683429752b4.tar.gz sl0ppij-c4d62f8f617a2fad50133e1b7829c683429752b4.tar.xz sl0ppij-c4d62f8f617a2fad50133e1b7829c683429752b4.zip | |
fix(crash): ensure ZELLIJ_TMP_DIR exists when starting plugins (#1256)
| -rw-r--r-- | zellij-server/src/wasm_vm.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zellij-server/src/wasm_vm.rs b/zellij-server/src/wasm_vm.rs index cc00aca9..cfd4f760 100644 --- a/zellij-server/src/wasm_vm.rs +++ b/zellij-server/src/wasm_vm.rs @@ -264,6 +264,15 @@ fn start_plugin( ) }); + // ensure tmp dir exists, in case it somehow was deleted (e.g systemd-tmpfiles) + fs::create_dir_all(ZELLIJ_TMP_DIR.as_path()).unwrap_or_else(|e| { + log::error!( + "Could not create ZELLIJ_TMP_DIR at {:?} \n Error: {:?}", + &ZELLIJ_TMP_DIR.as_path(), + e + ) + }); + let mut wasi_env = WasiState::new("Zellij") .env("CLICOLOR_FORCE", "1") .map_dir("/host", ".") |
