diff --git a/.changes/warn-dot-app-id.md b/.changes/warn-dot-app-id.md new file mode 100644 index 000000000000..514be44b88ff --- /dev/null +++ b/.changes/warn-dot-app-id.md @@ -0,0 +1,6 @@ +--- +"tauri-cli": "patch:feat" +"@tauri-apps/cli": "patch:feat" +--- + +Warn the user that the app id shouldn't end in `.app` because it conflicts with the application bundle extension on macOS diff --git a/crates/tauri-cli/src/build.rs b/crates/tauri-cli/src/build.rs index 0af5bac7ad9b..5d28657def85 100644 --- a/crates/tauri-cli/src/build.rs +++ b/crates/tauri-cli/src/build.rs @@ -150,6 +150,23 @@ pub fn setup( std::process::exit(1); } + if config_.identifier.ends_with(".app") { + if cfg!(target_os = "macos") { + log::error!( + "The bundle identifier \"{}\" set in `{} identifier` must not end with `.app` on macOS because it conflicts with the application bundle extension.", + config_.identifier, + bundle_identifier_source + ); + std::process::exit(1); + } else { + log::warn!( + "The bundle identifier \"{}\" set in `{} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.", + config_.identifier, + bundle_identifier_source + ); + } + } + if let Some(before_build) = config_.build.before_build_command.clone() { helpers::run_hook("beforeBuildCommand", before_build, interface, options.debug)?; }