Repository navigation
Preserve customized Xcode asset catalogs across regeneration - #713
Merged
Merged
Conversation
Folder-reference assets (Assets.xcassets on macOS, mediaAssets on iOS/
tvOS/visionOS/catOS) were being copied with a bare !exists guard. That
blocked a template bugfix from reaching projects that had never been
touched, and if the guard were loosened to always copy we'd wipe out
every user's own icons and media.
Factor the folder-copy into copyTemplateFolderIfUnchanged and make the
decision three-state:
CopyFresh destination missing, copy the template in.
CopyRefresh destination exists and is byte-identical to the template
(relative paths match, each file's bytes match, dotfiles
ignored) -- refresh in place so template bugfixes reach
untouched projects.
KeepCustom destination differs in any way (file added, removed, or
edited) -- leave the whole catalog alone, all-or-nothing,
never merge.
No sentinel files, no mtime checks, no hash manifests -- the compare is
strictly template-on-disk vs project-on-disk at regen time, so the
heuristic stays invisible to users and can't be committed by accident.
Apply the helper to both the macOS Assets.xcassets copy (new) and the
iOS/tvOS/visionOS mediaAssets copy (switched over). The macOS copy
no-ops cleanly when the template ships no Assets.xcassets, so this is
safe to land ahead of the openFrameworks template change.
GUI 0.125.0, CLI 0.130.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow template xcassets to copy and not override custom xcassets when icons are set