Skip to content

Commit

Permalink
feat(cli): associate newly created capability with the main window (#…
Browse files Browse the repository at this point in the history
…11512)

without this change the capability is not applied to any context and it might be hard for users to figure out why
  • Loading branch information
lucasfernog authored Oct 28, 2024
1 parent 1065f63 commit c43d5df
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/permission-add-default-windows.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion .github/workflows/publish-cli-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion crates/tauri-cli/src/acl/permission/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
));
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-cli/src/mobile/ios/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c43d5df

Please sign in to comment.