mirror of
https://github.com/zellij-org/zellij.git
synced 2024-12-23 17:22:28 +03:00
Install default layouts and plugins at build-time
This commit is contained in:
parent
e9e49ef45f
commit
555f9af37a
49
Cargo.lock
generated
49
Cargo.lock
generated
@ -407,6 +407,27 @@ version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
|
||||
|
||||
[[package]]
|
||||
name = "directories-next"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"dirs-sys-next",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs-sys-next"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"redox_users",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dtoa"
|
||||
version = "0.4.6"
|
||||
@ -882,6 +903,7 @@ dependencies = [
|
||||
"async-std",
|
||||
"backtrace",
|
||||
"bincode",
|
||||
"directories-next",
|
||||
"futures",
|
||||
"insta",
|
||||
"libc",
|
||||
@ -1142,13 +1164,32 @@ version = "0.1.57"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_termios"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
|
||||
dependencies = [
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.1.57",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_users"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
|
||||
dependencies = [
|
||||
"getrandom 0.2.0",
|
||||
"redox_syscall 0.2.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1356,7 +1397,7 @@ checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.1.57",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
@ -1437,7 +1478,7 @@ dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"libc",
|
||||
"rand",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.1.57",
|
||||
"remove_dir_all",
|
||||
"winapi",
|
||||
]
|
||||
@ -1459,7 +1500,7 @@ source = "git+https://gitlab.com/TheLostLambda/termion.git#70159e07c59c02dc681db
|
||||
dependencies = [
|
||||
"libc",
|
||||
"numtoa",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.1.57",
|
||||
"redox_termios",
|
||||
"serde",
|
||||
]
|
||||
|
@ -9,6 +9,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
backtrace = "0.3.55"
|
||||
bincode = "1.3.1"
|
||||
directories-next = "2.0"
|
||||
futures = "0.3.5"
|
||||
libc = "0.2"
|
||||
nix = "0.17.0"
|
||||
@ -34,6 +35,7 @@ features = ["unstable"]
|
||||
insta = "0.16.1"
|
||||
|
||||
[build-dependencies]
|
||||
directories-next = "2.0"
|
||||
structopt = "0.3"
|
||||
|
||||
[profile.release]
|
||||
|
8
assets/layouts/default.yaml
Normal file
8
assets/layouts/default.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
direction: Horizontal
|
||||
parts:
|
||||
- direction: Vertical
|
||||
- direction: Vertical
|
||||
split_size:
|
||||
Fixed: 1
|
||||
plugin: status-bar.wasm
|
23
build.rs
23
build.rs
@ -1,4 +1,5 @@
|
||||
use std::fs;
|
||||
use directories_next::ProjectDirs;
|
||||
use std::{fs, path::Path};
|
||||
use structopt::clap::Shell;
|
||||
|
||||
include!("src/cli.rs");
|
||||
@ -6,8 +7,9 @@ include!("src/cli.rs");
|
||||
const BIN_NAME: &str = "mosaic";
|
||||
|
||||
fn main() {
|
||||
// Generate Shell Completions
|
||||
let mut clap_app = CliArgs::clap();
|
||||
println!("cargo:rerun-if-changed=src/app.rs");
|
||||
println!("cargo:rerun-if-changed=src/cli.rs");
|
||||
let mut out_dir = std::env::var_os("CARGO_MANIFEST_DIR").unwrap();
|
||||
out_dir.push("/assets/completions");
|
||||
|
||||
@ -19,4 +21,21 @@ fn main() {
|
||||
clap_app.gen_completions(BIN_NAME, Shell::Bash, &out_dir);
|
||||
clap_app.gen_completions(BIN_NAME, Shell::Zsh, &out_dir);
|
||||
clap_app.gen_completions(BIN_NAME, Shell::Fish, &out_dir);
|
||||
|
||||
// Install Default Plugins and Layouts
|
||||
let assets = vec![
|
||||
"plugins/status-bar.wasm",
|
||||
"plugins/strider.wasm",
|
||||
"layouts/default.yaml",
|
||||
"layouts/strider.yaml",
|
||||
];
|
||||
let project_dirs = ProjectDirs::from("org", "Mosaic Contributors", "Mosaic").unwrap();
|
||||
let data_dir = project_dirs.data_dir();
|
||||
fs::create_dir_all(data_dir.join("plugins")).unwrap();
|
||||
fs::create_dir_all(data_dir.join("layouts")).unwrap();
|
||||
for asset in assets {
|
||||
println!("cargo:rerun-if-changed=assets/{}", asset);
|
||||
fs::copy(Path::new("assets/").join(asset), data_dir.join(asset))
|
||||
.expect("Failed to copy asset files");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user