adds zebrad as a bundled external binary (#4)

Co-authored-by: Automated Release Test <release-tests-no-reply@zfnd.org>
This commit is contained in:
Arya 2024-03-04 14:04:01 -05:00 committed by GitHub
parent 726beaf3ee
commit fd589615ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 8 deletions

Binary file not shown.

View File

@ -10,11 +10,9 @@ use std::{
use tauri::{AppHandle, Manager, RunEvent};
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
// TODO: Add a command for updating the config and restarting `zebrad` child process
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
fn save_config() {}
fn main() {
// Spawn initial zebrad process
@ -27,6 +25,9 @@ fn main() {
// Spawn a task for reading output and sending it to a channel
let (zebrad_log_sender, mut zebrad_log_receiver) = tokio::sync::mpsc::channel(100);
let zebrad_stdout = zebrad.stdout.take().expect("should have anonymous pipe");
// TODO: Use a blocking tokio/async_runtime thread? The io is blocking (reading the child process output from stdio), so
// it shouldn't use a green thread
let _log_emitter_handle = std::thread::spawn(move || {
for line in BufReader::new(zebrad_stdout).lines() {
// Ignore send errors for now
@ -48,7 +49,7 @@ fn main() {
Ok(())
})
.invoke_handler(tauri::generate_handler![greet])
.invoke_handler(tauri::generate_handler![save_config])
.build(tauri::generate_context!())
.unwrap()
.run(move |app_handle: &AppHandle, _event| {

View File

@ -1,14 +1,15 @@
{
"productName": "zebra-app",
"version": "0.0.0",
"identifier": "com.tauri.dev",
"identifier": "zebra.app",
"build": {
"beforeDevCommand": "yarn dev",
"devUrl": "http://localhost:1420",
"beforeBuildCommand": "yarn build",
"frontendDist": "../dist"
},
"app": {"windows": [
"app": {
"windows": [
{
"title": "zebra-app",
"width": 800,
@ -28,6 +29,7 @@
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
],
"externalBin": ["binaries/zebrad"]
}
}