diff --git a/.changes/add-tauri-get-version.md b/.changes/add-tauri-get-version.md new file mode 100644 index 000000000..b051a62dc --- /dev/null +++ b/.changes/add-tauri-get-version.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +Added `tauri::version` function to retrieve Tauri's version from Rust. diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index f064029d9..79b31e1eb 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -326,6 +326,11 @@ pub trait Runtime: runtime::Runtime {} impl> 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