Skip to content

Commit 0dd2cb4

Browse files
authored
always resolve icons relative to the crate, not the cwd of the CLI (#5020)
1 parent f7e102a commit 0dd2cb4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/cli/src/cli/bundle.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,18 @@ impl Bundle {
197197
}
198198
}
199199

200+
// resolve the icon relative to the crate, not the current working directory
201+
if let Some(icons) = bundle_settings.icon.as_mut() {
202+
for icon in icons {
203+
let icon_path = build
204+
.crate_dir()
205+
.join(&icon)
206+
.canonicalize()
207+
.with_context(|| format!("Failed to canonicalize path to icon {icon:?}"))?;
208+
*icon = icon_path.to_string_lossy().to_string();
209+
}
210+
}
211+
200212
if bundle_settings.resources_map.is_none() {
201213
bundle_settings.resources_map = Some(HashMap::new());
202214
}

0 commit comments

Comments
 (0)