|
@@ -174,13 +174,20 @@ pub fn is_configuration_file(target: Target, path: &Path) -> bool {
|
|
|
/// - `tauri.ios.conf.json[5]` or `Tauri.ios.toml` on iOS
|
|
|
/// Merging the configurations using [JSON Merge Patch (RFC 7396)].
|
|
|
///
|
|
|
+/// Returns the raw configuration and the platform config path, if any.
|
|
|
+///
|
|
|
/// [JSON Merge Patch (RFC 7396)]: https://datatracker.ietf.org/doc/html/rfc7396.
|
|
|
-pub fn read_from(target: Target, root_dir: PathBuf) -> Result<Value, ConfigError> {
|
|
|
+pub fn read_from(
|
|
|
+ target: Target,
|
|
|
+ root_dir: PathBuf,
|
|
|
+) -> Result<(Value, Option<PathBuf>), ConfigError> {
|
|
|
let mut config: Value = parse_value(target, root_dir.join("tauri.conf.json"))?.0;
|
|
|
- if let Some((platform_config, _)) = read_platform(target, root_dir)? {
|
|
|
+ if let Some((platform_config, path)) = read_platform(target, root_dir)? {
|
|
|
merge(&mut config, &platform_config);
|
|
|
+ Ok((config, Some(path)))
|
|
|
+ } else {
|
|
|
+ Ok((config, None))
|
|
|
}
|
|
|
- Ok(config)
|
|
|
}
|
|
|
|
|
|
/// Reads the platform-specific configuration file from the given root directory if it exists.
|