Skip to content

Commit 8ee14a8

Browse files
fix(cli): prevent .app identifier (fix #12674) (#13618)
* fix(cli): prevent .app identifier * chore(cli): changed warn log of non macOS * Add change file --------- Co-authored-by: Tony <legendmastertony@gmail.com>
1 parent 0f0d6a4 commit 8ee14a8

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.changes/warn-dot-app-id.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": "patch:feat"
3+
"@tauri-apps/cli": "patch:feat"
4+
---
5+
6+
Warn the user that the app id shouldn't end in `.app` because it conflicts with the application bundle extension on macOS

crates/tauri-cli/src/build.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ pub fn setup(
150150
std::process::exit(1);
151151
}
152152

153+
if config_.identifier.ends_with(".app") {
154+
if cfg!(target_os = "macos") {
155+
log::error!(
156+
"The bundle identifier \"{}\" set in `{} identifier` must not end with `.app` on macOS because it conflicts with the application bundle extension.",
157+
config_.identifier,
158+
bundle_identifier_source
159+
);
160+
std::process::exit(1);
161+
} else {
162+
log::warn!(
163+
"The bundle identifier \"{}\" set in `{} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.",
164+
config_.identifier,
165+
bundle_identifier_source
166+
);
167+
}
168+
}
169+
153170
if let Some(before_build) = config_.build.before_build_command.clone() {
154171
helpers::run_hook("beforeBuildCommand", before_build, interface, options.debug)?;
155172
}

0 commit comments

Comments
 (0)