Skip to content

Commit accdd7e

Browse files
committed
check if icon file exists before renaming
1 parent 121ddff commit accdd7e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

sbuild/src/builder.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl Builder {
235235
if let Some(ref desktop) = build_config.desktop {
236236
let out_path = if let Some(ref file) = desktop.file {
237237
self.logger.info(&format!("Using local file from {}", file));
238-
extract_filename(file)
238+
file.to_string()
239239
} else if let Some(ref dir) = desktop.dir {
240240
let out_path = format!("{}/{}.desktop", dir, build_config.pkg);
241241
self.logger
@@ -268,7 +268,7 @@ impl Builder {
268268
if let Some(ref icon) = build_config.icon {
269269
let out_path = if let Some(ref file) = icon.file {
270270
self.logger.info(&format!("Using local file from {}", file));
271-
extract_filename(file)
271+
file.to_string()
272272
} else if let Some(ref dir) = icon.dir {
273273
let dir_path = Path::new(dir);
274274

@@ -779,6 +779,9 @@ impl Builder {
779779
cmd: &str,
780780
) {
781781
let file_path = file_path.as_ref();
782+
if !file_path.exists() {
783+
return;
784+
}
782785
let magic_bytes = calc_magic_bytes(&file_path, 8);
783786
if let Some(extension) = if magic_bytes == PNG_MAGIC_BYTES {
784787
Some("png")

0 commit comments

Comments
 (0)