Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

jason-crabnebula
Copy link
Contributor

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
Copy link
Member

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

@amr-crabnebula
Copy link
Collaborator

yeah we should create the out-dir upfront

@jason-crabnebula
Copy link
Contributor Author

Hmm, it creates the dir before invoking create_icns_file(). Maybe we should canonicalize the new created folder path on line 1800?

} else if self.out_dir.exists() {
dunce::canonicalize(&self.out_dir).unwrap_or_else(|_| self.out_dir.clone())
} else {
std::fs::create_dir_all(&self.out_dir).expect("failed to create output directory");
self.out_dir.clone()
}

@amr-crabnebula
Copy link
Collaborator

@jason-crabnebula sounds good

@amr-crabnebula amr-crabnebula merged commit 21441f3 into crabnebula-dev:main Aug 21, 2024
15 of 22 checks passed
@jason-crabnebula jason-crabnebula deleted the fix/dmg-out-dir-fail branch August 21, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants