Start working on layout patching
This commit is contained in:
parent
4c662fc6d0
commit
f4f6e3c66b
4 changed files with 31 additions and 0 deletions
|
|
@ -15,6 +15,37 @@ dependencies = ["pre-test"]
|
||||||
[tasks.post-test]
|
[tasks.post-test]
|
||||||
env = { "SKIP_TEST" = false }
|
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
|
# Running Zellij
|
||||||
|
|
||||||
# Change the build to always use the assets, but not delete them by default
|
# Change the build to always use the assets, but not delete them by default
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue