Skip to content

Commit

Permalink
Handle mu plugin too
Browse files Browse the repository at this point in the history
  • Loading branch information
tlovett1 committed May 21, 2024
1 parent a0bcd45 commit 5344446
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions packages/toolkit/scripts/project/bash/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ find "$init_path" -type f -exec sed -i '' -e "s/tenup_/${project_name_lowercase_

theme_path="$init_path/themes/${project_name_lowercase_hypen}-theme"
plugin_path="$init_path/plugins/${project_name_lowercase_hypen}-plugin"
mu_plugin_path="$init_path/mu-plugins/${project_name_lowercase_hypen}-plugin"

# Rename directory themes/tenup-theme to themes/$project_name_lowercase_hypen-theme
if [ -d "$init_path/themes/tenup-theme" ]; then
Expand All @@ -54,12 +55,22 @@ if [ -d "$init_path/plugins/10up-plugin" ]; then
mv "$init_path/plugins/10up-plugin" "$plugin_path"
fi

# Replace tenup-theme
if [ -d "$init_path/mu-plugins/10up-plugin" ]; then
mv "$init_path/mu-plugins/10up-plugin" "$mu_plugin_path"
fi

find "$init_path" -type f -exec sed -i '' -e "s/tenup-theme/${project_name_lowercase_hypen}-theme/g" {} \;

# Replace tenup-plugin
find "$init_path" -type f -exec sed -i '' -e "s/tenup-plugin/${project_name_lowercase_hypen}-plugin/g" {} \;

find "$init_path" -type f -exec sed -i '' -e "s/10up-plugin/${project_name_lowercase_hypen}-plugin/g" {} \;

find "$init_path" -type f -exec sed -i '' -e "s/tenup-wp-scaffold/${project_name_lowercase_hypen}/g" {} \;

find "$init_path" -type f -exec sed -i '' -e "s/10up\/wp-theme/10up\/${project_name_lowercase_hypen}-theme/g" {} \;

find "$init_path" -type f -exec sed -i '' -e "s/10up\/wp-plugin/10up\/${project_name_lowercase_hypen}-plugin/g" {} \;

find "$init_path" -type f -exec sed -i '' -e "s/10up Plugin/${project_name} Plugin/g" {} \;
find "$init_path" -type f -exec sed -i '' -e "s/Tenup Plugin/${project_name} Plugin/g" {} \;
find "$init_path" -type f -exec sed -i '' -e "s/10up Theme/${project_name} Theme/g" {} \;
Expand All @@ -76,3 +87,7 @@ fi
if [ -d "$plugin_path" ]; then
composer update --no-interaction --working-dir="$plugin_path"
fi

if [ -d "$mu_plugin_path" ]; then
composer update --no-interaction --working-dir="$mu_plugin_path"
fi

0 comments on commit 5344446

Please sign in to comment.