diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-02-25 23:26:31 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-02-25 23:26:31 +0000 |
| commit | 0d201485189df8b66f29f7972023880ab183f2ae (patch) | |
| tree | d62a7f19ae18eaea8ab22ed2c58ee398cda3b38a /src | |
| parent | infra(crates.io): try to include wasm assets (diff) | |
| download | sl0ppij-0d201485189df8b66f29f7972023880ab183f2ae.tar.gz sl0ppij-0d201485189df8b66f29f7972023880ab183f2ae.tar.xz sl0ppij-0d201485189df8b66f29f7972023880ab183f2ae.zip | |
infra(crates.io): allow publishing by including assets from a different path
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index c4123e55..716acb91 100644 --- a/src/main.rs +++ b/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); |
