Skip to content

Commit 08bb992

Browse files
committed
add version to bridge and add that to health check
1 parent b48b429 commit 08bb992

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

crates/bridge/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ enum Commands {
101101
#[clap(value_name = "SCRIPT_API_FILE", index = 1)]
102102
input: PathBuf,
103103
},
104+
/// Print the version of this executable
105+
Version,
104106
}
105107

106108
fn main() -> Result<()> {
@@ -220,6 +222,9 @@ fn main() -> Result<()> {
220222

221223
println!("{res}");
222224
}
225+
Commands::Version => {
226+
println!("{}", env!("CARGO_PKG_VERSION"));
227+
}
223228
}
224229

225230
Ok(())

lua/defold/health.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ function M.check()
2121
local bridge_path_ok, bridge_path = pcall(sidecar.find_bridge_path, require("defold").plugin_root())
2222
if bridge_path_ok then
2323
vim.health.ok(string.format("Bridge Path: %s", bridge_path))
24+
25+
local bridge_version_ok, bridge_version = pcall(function()
26+
return vim.fn.system { bridge_path, "version" }
27+
end)
28+
29+
if bridge_version_ok then
30+
vim.health.ok(string.format("Bridge Version: %s", vim.trim(bridge_version)))
31+
else
32+
vim.health.error(string.format("Bridge Version: Could not get version: %s", bridge_version))
33+
end
2434
else
2535
vim.health.error(string.format("Bridge Not Found: %s", bridge_path))
2636
end

0 commit comments

Comments
 (0)