Fix chromium backend icon write failing with ENOENT
The chromium build path created a TempDir via `tempdir()?.path().join(...)`,
which dropped the TempDir at the end of the statement and deleted the
directory before fetch_or_create_icon could write into it. Every
`deskify build --backend chromium` failed with:
Error: Failed to write RGBA PNG icon to /tmp/.tmpXXXXXX/icon.png
Caused by: No such file or directory (os error 2)
Bind the TempDir to a local like the tauri branch already does so it
lives until the icon has been written and copied to its final location.
This commit is contained in:
@@ -56,7 +56,8 @@ fn execute_build(args: &BuildArgs, dry_run: bool, print_config: bool) -> Result<
|
||||
"Installing Chromium app '{}' for URL: {}",
|
||||
args.name, args.url
|
||||
);
|
||||
let temp_icon = tempdir()?.path().join("icon.png");
|
||||
let dir = tempdir().context("Failed to create temporary directory for building")?;
|
||||
let temp_icon = dir.path().join("icon.png");
|
||||
icon::fetch_or_create_icon(&args.url, args.icon.as_ref(), &temp_icon)?;
|
||||
install::install_chromium_app(args, &temp_icon)?;
|
||||
app::write_app_config_from_args(args)?;
|
||||
|
||||
Reference in New Issue
Block a user