Skip to content

Commit

Permalink
feat(core): add config and package_info getters on App and AppHan…
Browse files Browse the repository at this point in the history
…dle (#2016)
  • Loading branch information
lucasfernog committed Jun 20, 2021
1 parent 94dbc96 commit 70fc87a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/config-package-info-getters.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Adds `config` and `package_info` getters to the `App` and `AppHandle` structs.
10 changes: 10 additions & 0 deletions core/tauri/src/app.rs
Expand Up @@ -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()
}
}
};
}
Expand Down

0 comments on commit 70fc87a

Please sign in to comment.