summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-03-30 12:49:42 +0100
committerBrooks J Rady <b.j.rady@gmail.com>2021-03-30 12:49:42 +0100
commitf4f6e3c66bbaee91321c293df1beb5c5d6e4e441 (patch)
treed02315d6415842728a30b1fd6117b9a4abe8581c
parent4c662fc6d08009fcdfa5b49e7875e44abf3971d8 (diff)
Start working on layout patching
-rw-r--r--Makefile.toml31
-rw-r--r--assets/plugins/status-bar.wasmbin418654 -> 442368 bytes
-rw-r--r--assets/plugins/strider.wasmbin515536 -> 551589 bytes
-rw-r--r--assets/plugins/tab-bar.wasmbin388133 -> 439000 bytes
4 files changed, 31 insertions, 0 deletions
diff --git a/Makefile.toml b/Makefile.toml
index 8856854cd..03c1eef70 100644
--- a/Makefile.toml
+++ b/Makefile.toml
@@ -15,6 +15,37 @@ dependencies = ["pre-test"]
[tasks.post-test]
env = { "SKIP_TEST" = false }
+[tasks.run]
+workspace = false
+dependencies = ["build"]
+run_task = { name = ["patch-layouts", "run-zellij"] }
+
+## Need to walk the layout YAML and patch the plugin fields!
+[tasks.patch-layouts]
+script_runner = "@rust"
+script = '''
+//! ```cargo
+//! [dependencies]
+//! yaml-rust = "0.4"
+//! ```
+use std::{fs, env, error::Error, path::Path};
+use yaml_rust::{YamlLoader, YamlEmitter};
+
+fn main() -> Result<(), Box<dyn Error>> {
+ let root = env::var("CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY")?;
+ let layout_path = Path::new(&root).join("assets/layouts");
+ for layout in fs::read_dir(layout_path)? {
+ let yaml = fs::read_to_string(layout?.path())?;
+ let yaml = YamlLoader::load_from_str(&yaml)?[0];
+ }
+ Ok(())
+}
+'''
+
+[tasks.run-zellij]
+
+
+
# Running Zellij
# Change the build to always use the assets, but not delete them by default
diff --git a/assets/plugins/status-bar.wasm b/assets/plugins/status-bar.wasm
index 7a5b0e513..0a72d5c17 100644
--- a/assets/plugins/status-bar.wasm
+++ b/assets/plugins/status-bar.wasm
Binary files differ
diff --git a/assets/plugins/strider.wasm b/assets/plugins/strider.wasm
index ec4793534..d0dd9278d 100644
--- a/assets/plugins/strider.wasm
+++ b/assets/plugins/strider.wasm
Binary files differ
diff --git a/assets/plugins/tab-bar.wasm b/assets/plugins/tab-bar.wasm
index e895d7eaf..d0b32e021 100644
--- a/assets/plugins/tab-bar.wasm
+++ b/assets/plugins/tab-bar.wasm
Binary files differ