build(actually reinstall updated plugins)

This commit is contained in:
Brooks J Rady 2021-02-23 20:27:22 +00:00
parent 683c152fa2
commit 1acff8916f

View file

@ -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")));