feat: add tauri::version, similar to getTauriVersion available on JS API (#6546)

Signed-off-by: goenning <me@goenning.net>

Apply suggestions from code review
This commit is contained in:
Guilherme Oenning
2023-05-12 13:36:31 +01:00
committed by GitHub
parent fb485d25a0
commit 7c23720920
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri": "patch"
---
Added `tauri::version` function to retrieve Tauri's version from Rust.

View File

@@ -326,6 +326,11 @@ pub trait Runtime: runtime::Runtime<EventLoopMessage> {}
impl<W: runtime::Runtime<EventLoopMessage>> Runtime for W {}
/// Returns Tauri version.
pub fn version() -> &'static str {
env!("CARGO_PKG_VERSION")
}
/// Reads the config file at compile time and generates a [`Context`] based on its content.
///
/// The default config file path is a `tauri.conf.json` file inside the Cargo manifest directory of