feat(core): add config and package_info getters on App and AppHandle (#2016)

This commit is contained in:
Lucas Fernandes Nogueira
2021-06-20 09:42:11 -03:00
committed by GitHub
parent 94dbc96c97
commit 70fc87a7ff
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri": patch
---
Adds `config` and `package_info` getters to the `App` and `AppHandle` structs.

View File

@@ -216,6 +216,16 @@ macro_rules! shared_app_impl {
package_info: self.manager.package_info().clone(),
}
}
/// Gets the app's configuration, defined on the `tauri.conf.json` file.
pub fn config(&self) -> Arc<Config> {
self.manager.config()
}
/// Gets the app's package information.
pub fn package_info(&self) -> &PackageInfo {
self.manager.package_info()
}
}
};
}