OER-WEB-TEAM / design-system--drupal-theme

1 stars 0 forks source link

Create BATCH script to ease up first-setup process #27

Closed AlexVanK closed 6 months ago

AlexVanK commented 6 months ago

The subtheme boilerplate exists as a zipped package in this repository. Upon first installation, web admins are required to cut/paste that .zip file in the /themes directory of Drupal and then unzip it. These two steps are too many, as nobody wants to read documentations :sweat:

Create a BATCH (.bat) script to do this automatically: 1-click setup.

Document this in quick-setup page on website: https://styleguide.od.nih.gov/quick-setup

AlexVanK commented 6 months ago

The problem with this approach is that the .zip and .bat files are always regenerated upon the user updating the NIHOD theme. Consider updating the .bat script to fetch the required files from this repo, only if they do not exist in the parent directory: /themes

AlexVanK commented 6 months ago

Also, because of the packaging mechanism of GitHub, this project will not have the folder name that we want. See #30

AlexVanK commented 6 months ago

Done.

The batch script init.bat workflow is the following:

Check if subtheme exists in parent folder (/themes), if not:

1 - Download subtheme from major version related branch
2 - Unzip
3 - Rename unzipped folder to nihod5__subtheme
4 - Move it to the parent directory (/themes)
5 - cleanup download file of step 1

With the if/else logic, the batch script doesn't need to be removed (it will always be present in the root directory of this project)