mirror of
https://github.com/zellij-org/zellij.git
synced 2024-12-24 17:53:36 +03:00
infra(crates.io): allow publishing by including assets from a different path
This commit is contained in:
parent
e2217564c2
commit
0d20148518
@ -7,7 +7,8 @@ description = "Terminal workspace (WIP)"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/zellij-org/zellij"
|
||||
|
||||
include = ["target/*.wasm"]
|
||||
[features]
|
||||
publish = []
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
@ -20,4 +20,4 @@ wasm-opt -O target/wasm32-wasi/release/status-bar.wasm -o assets/plugins/status-
|
||||
wasm-opt -O target/wasm32-wasi/release/strider.wasm -o assets/plugins/strider.wasm
|
||||
wasm-opt -O target/wasm32-wasi/release/tab-bar.wasm -o assets/plugins/tab-bar.wasm
|
||||
echo "Publishing zellij (6/$total)..."
|
||||
cargo publish $@
|
||||
cargo publish --features publish $@
|
||||
|
18
src/main.rs
18
src/main.rs
@ -31,13 +31,23 @@ pub fn main() {
|
||||
// First run installation of default plugins & layouts
|
||||
let project_dirs = ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
|
||||
let data_dir = project_dirs.data_dir();
|
||||
let assets = asset_map! {
|
||||
"target/status-bar.wasm" => "plugins/status-bar.wasm",
|
||||
"target/tab-bar.wasm" => "plugins/tab-bar.wasm",
|
||||
"target/strider.wasm" => "plugins/strider.wasm",
|
||||
let mut assets = asset_map! {
|
||||
"assets/layouts/default.yaml" => "layouts/default.yaml",
|
||||
"assets/layouts/strider.yaml" => "layouts/strider.yaml",
|
||||
};
|
||||
// FIXME: This is a hideous hack and I hate it (a lot)
|
||||
#[cfg(not(feature = "publish"))]
|
||||
assets.extend(asset_map! {
|
||||
"target/status-bar.wasm" => "plugins/status-bar.wasm",
|
||||
"target/tab-bar.wasm" => "plugins/tab-bar.wasm",
|
||||
"target/strider.wasm" => "plugins/strider.wasm",
|
||||
});
|
||||
#[cfg(feature = "publish")]
|
||||
assets.extend(asset_map! {
|
||||
"assets/plugins/status-bar.wasm" => "plugins/status-bar.wasm",
|
||||
"assets/plugins/tab-bar.wasm" => "plugins/tab-bar.wasm",
|
||||
"assets/plugins/strider.wasm" => "plugins/strider.wasm",
|
||||
});
|
||||
|
||||
for (path, bytes) in assets {
|
||||
let path = data_dir.join(path);
|
||||
|
Loading…
Reference in New Issue
Block a user