File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,43 @@ PROJECT_NAME="$( basename ${PROJECT_DIR} | tr '[:upper:]' '[:lower:]' )"
2828PHP_CONTAINER_NAME=" ${PROJECT_NAME} _shopware546_php${VERSION} _1"
2929WORK_DIR=" /var/www/shopware54_php${VERSION} "
3030
31- PLUGIN_DIRECTORY=" custom/plugins/$PROJECT_NAME "
31+ PLUGIN_NAME=$( find . -name ' *.php' -maxdepth 1 | sed ' s#.*/##' | sed ' s/\.php$//1' )
32+
33+ PLUGIN_DIRECTORY=" custom/plugins/$PLUGIN_NAME "
3234
3335function init_plugin {
34- echo " Init plugin $PROJECT_NAME "
36+ echo " Init plugin $PLUGIN_NAME "
3537 link_plugin
38+ install_plugin
39+ activate_plugin
3640}
3741
3842function link_plugin {
3943 echo " Link plugin $PROJECT_NAME to $PLUGIN_DIRECTORY "
40- docker exec --workdir ${WORK_DIR} -it ${PHP_CONTAINER_NAME} ln -s /opt/host $PLUGIN_DIRECTORY
44+ execute_in_docker " ln -s /opt/host $PLUGIN_DIRECTORY "
45+ }
46+
47+ function install_plugin {
48+ execute_in_docker " bin/console sw:plugin:refresh"
49+ execute_in_docker " bin/console sw:plugin:install $PLUGIN_NAME "
50+ }
51+
52+ function activate_plugin {
53+ execute_in_docker " bin/console sw:plugin:activate $PLUGIN_NAME "
54+ execute_in_docker " bin/console sw:cache:clear"
4155}
4256
4357function reset_plugin {
58+ execute_in_docker " bin/console sw:plugin:refresh"
59+
4460 echo " reset plugin"
4561}
4662
63+ function execute_in_docker {
64+
65+ docker exec --workdir ${WORK_DIR} -it ${PHP_CONTAINER_NAME} $1
66+ }
67+
4768# # start of the real program
4869
4970export PROJECT_DIR
You can’t perform that action at this time.
0 commit comments