feat(cli): associate newly created capability with the main window (#11512)

without this change the capability is not applied to any context and it might be hard for users to figure out why
This commit is contained in:
Lucas Fernandes Nogueira 2024-10-28 08:05:24 -03:00 committed by GitHub
parent 1065f632f2
commit c43d5df158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View File

@ -0,0 +1,6 @@
---
"@tauri-apps/cli": patch:enhance
"tauri-cli": patch:enhance
---
Associate a newly created capability file with the `main` window on the `tauri add` and `tauri permission add` commands.

View File

@ -108,7 +108,6 @@ jobs:
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.settings.target }}
working-directory: 'crates/tauri-cli/'
if: ${{ matrix.settings.docker }}
- name: Setup toolchain
run: ${{ matrix.settings.setup }}

View File

@ -187,7 +187,8 @@ pub fn command(options: Options) -> Result<()> {
capabilities.push((
TomlOrJson::Json(serde_json::json!({
"identifier": identifier,
"platforms": expected_platforms
"platforms": expected_platforms,
"windows": ["main"]
})),
capability_path,
));

View File

@ -132,7 +132,7 @@ pub fn get_config(
log::warn!("No code signing certificates found. You must add one and set the certificate development team ID on the `bundle > iOS > developmentTeam` config value or the `{APPLE_DEVELOPMENT_TEAM_ENV_VAR_NAME}` environment variable. To list the available certificates, run `tauri info`.");
None
}
1 =>None,
1 => None,
_ => {
log::warn!("You must set the code signing certificate development team ID on the `bundle > iOS > developmentTeam` config value or the `{APPLE_DEVELOPMENT_TEAM_ENV_VAR_NAME}` environment variable. Available certificates: {}", teams.iter().map(|t| format!("{} (ID: {})", t.name, t.id)).collect::<Vec<String>>().join(", "));
None