serde issues fixed in alias

This commit is contained in:
Drew Tada 2024-02-08 14:52:57 -05:00
parent 0833489ce7
commit 4ad3dcbbab
2 changed files with 8 additions and 12 deletions

View File

@ -2,7 +2,6 @@ use kinode_process_lib::{
await_next_request_body, call_init, println, Address, ProcessId, Request,
};
use serde::{Deserialize, Serialize};
use serde_json::json;
wit_bindgen::generate!({
path: "wit",
@ -46,13 +45,11 @@ fn init(_our: Address) {
let _ = Request::new()
.target(("our", "terminal", "terminal", "sys"))
.body(
json!(TerminalAction::EditAlias {
serde_json::to_vec(&TerminalAction::EditAlias {
alias: alias.to_string(),
process: None
process: None,
})
.to_string()
.as_bytes()
.to_vec(),
.unwrap(),
)
.send();
} else {
@ -61,13 +58,11 @@ fn init(_our: Address) {
let _ = Request::new()
.target(("our", "terminal", "terminal", "sys"))
.body(
json!(TerminalAction::EditAlias {
serde_json::to_vec(&TerminalAction::EditAlias {
alias: alias.to_string(),
process: Some(process)
process: Some(process),
})
.to_string()
.as_bytes()
.to_vec(),
.unwrap(),
)
.send();
}

View File

@ -169,7 +169,8 @@ fn handle_run(
pipe: Option<(String, u64)>,
) -> anyhow::Result<()> {
let wasm_path = format!("{}.wasm", process.process());
let drive_path = format!("/{}:{}/pkg", process.package(), process.publisher());
let package = format!("{}:{}", process.package(), process.publisher());
let drive_path = format!("/{}/pkg", package);
let Ok(entry) = get_entry(process) else {
return Err(anyhow::anyhow!("script not in scripts.json file"));
};