Accommodate child themes: Update WP stylesheet_root separately #850
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.
This PR is a piece of the former #848 and addresses https://discourse.roots.io/t/template-root-not-updated-by-env/9724
When a child theme is in Bedrock
web/app/themes
and its parent theme is in different directory (e.g.,web/wp/wp-content/themes
),stylesheet_root
must be/themes
whiletemplate_root
should be updated with the latest deploy releases_path. Prior to this commit,stylesheet_root
was always updated withtemplate_root
, causing problems for some child themes.Regarding the
regex_replace
: Till now Trellis has assumed that if atemplate_root
includes the releases path (e.g., /srv/www/example.com/releases) then we can replace the entiretemplate_root
using the new release path +/web/wp/wp-content/themes
. Maybe that's a safe assumption, but at my level of familiarity, the only thing I feel safe saying is that "I know the release path portion can be replaced with the new release path, but I don't know about the rest of the path."That's why you'll notice that I made the following replacement (pseudo code):
The only weakness I can think of for this change is that it is less readable. Maybe someone who knows more will say that the original assumption was safe, implying that this change is unnecessary.