fix(cli/icon): return with an error instead of panic (#9638)

* fix(cli/icon): return with an error instead of panic

closes #9636

* Update .changes/cli-icon-non-0-exit.md
This commit is contained in:
Amr Bashir 2024-05-02 14:26:53 +03:00 committed by GitHub
parent 7f6d2698c9
commit 97ec422f22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
"tauri-cli": "patch:bug"
"@tauri-apps/cli": "patch:bug"
---
Exit `tauri icon` with non-zero code when it fails.

View File

@ -138,11 +138,11 @@ pub fn command(options: Options) -> Result<()> {
))
}
} else {
panic!("Error loading image");
anyhow::bail!("Error loading image");
};
if source.height() != source.width() {
panic!("Source image must be square");
anyhow::bail!("Source image must be square");
}
if png_icon_sizes.is_empty() {