mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-05 10:13:00 +02:00
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:
committed by
GitHub
parent
fb485d25a0
commit
7c23720920
5
.changes/add-tauri-get-version.md
Normal file
5
.changes/add-tauri-get-version.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": "patch"
|
||||
---
|
||||
|
||||
Added `tauri::version` function to retrieve Tauri's version from Rust.
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user