fix: symlink project with underscores instead of hyphens #35
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 fixes an issue with projects that use 'underscores' in their name.
This can lead to inconsistency when using a project name as the sym-linked folder name.
Problem
I have a module named 'apple_banana'.
Drupal rules state machine name as "only lower-case letters, digits, and underscores" (https://www.drupal.org/docs/develop/creating-modules/naming-and-placing-your-drupal-module#s-name-your-module)
Given this module is in a directory called
apple_banana
, I am unable to create a DDEV project in this folder:If I rename the project folder to
apple-banana
, DDEV creates successfully. (If not provided, DDEV automatically uses the folder name, hereapple-banana
, as site name)When I run
ddev symlink-project
, the project is linked asweb/modules/custom/apple-banana
(using$DDEV_SITENAME
).This functions, but leads to a problem with local translations,
%project
should resolve to the module machine nameIf this was hardcoded with the module name, it would be expecting to find the 'underscored' machine-name version of the module.
@see https://api.drupal.org/api/drupal/core%21modules%21locale%21locale.api.php/group/interface_translation_properties/10