From 1acff8916fb9dafbcbdb64a7ffd49242d1943281 Mon Sep 17 00:00:00 2001 From: Brooks J Rady Date: Tue, 23 Feb 2021 20:27:22 +0000 Subject: [PATCH] build(actually reinstall updated plugins) --- build.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index d9c9f681..a9a8c808 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,5 @@ use directories_next::ProjectDirs; -use std::fs; +use std::{ffi::OsStr, fs}; use structopt::clap::Shell; use walkdir::WalkDir; @@ -24,11 +24,21 @@ fn main() { clap_app.gen_completions(BIN_NAME, Shell::Fish, &out_dir); // Clear Default Plugins and Layouts + + // Rerun on layout change for entry in WalkDir::new("assets/layouts") { let entry = entry.unwrap(); println!("cargo:rerun-if-changed={}", entry.path().to_string_lossy()); } + // Rerun on plugin change + for entry in WalkDir::new("target") { + let entry = entry.unwrap(); + if entry.path().extension() == Some(OsStr::new("wasm")) { + println!("cargo:rerun-if-changed={}", entry.path().to_string_lossy()); + } + } + let project_dirs = ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap(); let data_dir = project_dirs.data_dir(); drop(fs::remove_file(data_dir.join("plugins/status-bar.wasm")));