crabnebula-dev / cargo-packager

Rust executable packager, bundler and updater.
https://docs.crabnebula.dev/packager/
Apache License 2.0
241 stars 16 forks source link

fix(dmg): canonicalize path returns from `create_icns_file` #262

Closed jason-crabnebula closed 1 month ago

jason-crabnebula commented 2 months ago

When out-dir is provided but does not exist, create_icns_file() returns a relative path (out/dir/icon.icns). Calling the create-dmg script will change the working dir to out-dir. When copying the volume icon, the icon does not exist at the path (out/dir/out/dir/icon.icns).

lucasfernog-crabnebula commented 2 months ago

@amr-crabnebula shouldn't we create the out-dir upfront instead of making this change? what's your opinion?

amr-crabnebula commented 2 months ago

yeah we should create the out-dir upfront

jason-crabnebula commented 2 months ago

Hmm, it creates the dir before invoking create_icns_file(). Maybe we should canonicalize the new created folder path on line 1800? https://github.com/crabnebula-dev/cargo-packager/blob/937de616aacac41c8e104e0d6abba4929e60b85a/crates/packager/src/config/mod.rs#L1796-L1801

amr-crabnebula commented 1 month ago

@jason-crabnebula sounds good