emulsify icon indicating copy to clipboard operation
emulsify copied to clipboard

Scaffolding Script - PATH Support

Open ccjjmartin opened this issue 6 years ago • 0 comments

Purpose:

  • Currently the emulisfy.php script doesn't properly replace paths.

Priority Notes:

  • The priority for the feature is likely low as it is pretty easy to replace theme paths when creating a new theme
  • The need for this might be limited to a single file, needs some additional research into how wide spread this might be

Example of need for this:

  • https://github.com/fourkitchens/emulsify/pull/268/files#diff-4f57bc4083b092de57c07dfd3f7081b9R13
  • NOTE: This line assumes you have placed your new theme in the /themes/custom directory which might not be the case.

Original Discussion

  • See original PR: https://github.com/fourkitchens/emulsify/pull/268/files

Additional Implementation Details:

Ok, I was focused on the comment containing the string emulsify but that actually isn't the main change here. I should have been looking at the YOURTHEME versus emulsify. I am good with this change because it makes the out of the box experience better in most scenarios. I will point out that this is not going to work for people who don't put their theme in the root of /themes/ versus /themes/custom/ But that is likely a bigger issue that what we are trying to address here. We should consider replacing this (in another PR not this one) with just a string called PATH and then it drops in the theme path.

Alterations are defined in the _emulsify_get_alterations function which is currently only doing these:

'Emulsify' => $human_readable_name,
'emulsify' => $machine_name,
'Theme that uses Pattern Lab v2' => $description,
'hidden: true' => '',

It would be pretty easy to add a new line:

'PATH' => $path,

And add another parameter for to that same function to pass the path in. When I wrote this I wasn't thinking we would need the PATH within the twig files.

ccjjmartin avatar Jul 06 '18 21:07 ccjjmartin