commit 0caae793ec62a828860c9bc6a9b3c1a74237eecc
parent 7295ea536717320f4012a3bb7b8fb945d469b881
Author: Sylvia Ivory <git@sivory.net>
Date: Tue, 1 Jul 2025 22:15:29 -0700
Embed RPC code into binary
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lua.rs b/src/lua.rs
@@ -94,6 +94,8 @@ impl RpcCommand {
}
}
+const RPC_CODE: &str = include_str!("../lua/rpc.lua");
+
impl SystemLuaExecutor {
pub fn new(program: &str) -> Result<Self, SystemLuaError> {
Ok(Self {
@@ -105,7 +107,9 @@ impl SystemLuaExecutor {
fn obtain_process(program: &str) -> Result<PtySession, SystemLuaError> {
let mut cmd = Command::new(program);
- cmd.arg("lua/rpc.lua");
+
+ cmd.arg("-e");
+ cmd.arg(RPC_CODE);
Ok(spawn_command(cmd, None)?)
}