mirror of
https://git.northern.co/onpoint-suite/drupal_yp_install_profile.git
synced 2024-10-31 17:05:32 +00:00
Merge pull request #5 from yellowpencil/starter-theme-script-may-26-2021
Starter Theme Script
This commit is contained in:
commit
81b23d7b69
@ -30,6 +30,7 @@ This section will include what's included in the profile install.
|
|||||||
- YP Alerts Module
|
- YP Alerts Module
|
||||||
- YP Admin Guide Module (WIP)
|
- YP Admin Guide Module (WIP)
|
||||||
- Translations are ready to be enabled and used
|
- Translations are ready to be enabled and used
|
||||||
|
- YP `fe_setup` script has been adapted and added for use with composer install
|
||||||
|
|
||||||
#### Installed modules
|
#### Installed modules
|
||||||
|
|
||||||
|
|||||||
39
starter_theme.sh
Normal file
39
starter_theme.sh
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
echo Would you like to install a theme using the FE Setup script? \(y/n\) Be sure not to overwrite an existing theme.
|
||||||
|
read install_theme
|
||||||
|
if [ $install_theme == 'y' -o $install_theme == 'Y' ]
|
||||||
|
then
|
||||||
|
echo What is the theme name? \(This value should be all lowercase, and will replace \'yellowpencil\' in the starter theme.\)
|
||||||
|
read theme_name
|
||||||
|
echo What is the URL of the project repository? \(This should follow the format \'https://git.yellowpencil.com/yellowpencil/theme-name\'.\)
|
||||||
|
read repo_url
|
||||||
|
SEARCH_PATH=web/themes
|
||||||
|
SEARCH=yellowpencil
|
||||||
|
SEARCH_R=[Yy]ellow[Pp]encil
|
||||||
|
REPLACE=$theme_name
|
||||||
|
REPO=$repo_url
|
||||||
|
if [ -d "$SEARCH_PATH/$REPLACE" -a ! -h "$SEARCH_PATH/$REPLACE" ]
|
||||||
|
then
|
||||||
|
BLACK_BG=`tput setaf 0`
|
||||||
|
YELLOW_TXT=`tput setab 3`
|
||||||
|
RESET=`tput sgr0`
|
||||||
|
echo "${YELLOW_TXT}${BLACK_BG} Theme already exists. ${RESET}";
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
git clone git@git.yellowpencil.com:yellowpencil/yp_drupal8_theme.git $SEARCH_PATH/$REPLACE
|
||||||
|
mv $SEARCH_PATH/$REPLACE/yellowpencil/* $SEARCH_PATH/$REPLACE
|
||||||
|
rm -r $SEARCH_PATH/$REPLACE/yellowpencil
|
||||||
|
rm -rf $SEARCH_PATH/$REPLACE/.git
|
||||||
|
rm -rf $SEARCH_PATH/$REPLACE/.gitignore
|
||||||
|
find ${SEARCH_PATH} -type f -name "*${SEARCH}*" | while read FILENAME ; do
|
||||||
|
NEW_FILENAME="$(echo ${FILENAME} | sed -e "s/${SEARCH}/${REPLACE}/g")";
|
||||||
|
mv "${FILENAME}" "${NEW_FILENAME}";
|
||||||
|
done
|
||||||
|
find ${SEARCH_PATH} -type f -name "*.twig" -print0 | xargs -0 sed -i '' -e "s/${SEARCH_R}/${REPLACE}/g"
|
||||||
|
find ${SEARCH_PATH} -type f -name "*.theme" -print0 | xargs -0 sed -i '' -e "s/${SEARCH_R}/${REPLACE}/g"
|
||||||
|
find ${SEARCH_PATH} -type f -name "*.yml" -print0 | xargs -0 sed -i '' -e "s/${SEARCH_R}/${REPLACE}/g"
|
||||||
|
find ${SEARCH_PATH} -type f -name "*.txt" -print0 | xargs -0 sed -i '' -e "s/${SEARCH_R}/${REPLACE}/g"
|
||||||
|
PACKAGE_FILE=$(find ${SEARCH_PATH}/${REPLACE} -type f -name "package.json" -print0)
|
||||||
|
sed -i '' -e "s/${SEARCH_R}/${REPLACE}/g" $PACKAGE_FILE
|
||||||
|
sed -i '' -e "s,https:\/\/[^\"#]*,${REPO},g" $PACKAGE_FILE
|
||||||
|
echo $REPO_REPLACE
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue
Block a user