-
Notifications
You must be signed in to change notification settings - Fork 0
/
wpuplugincreator.sh
90 lines (73 loc) · 2.36 KB
/
wpuplugincreator.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
WPUPluginCreator(){
local _WPUPLUGINCREATOR_VERSION='0.45.6';
local _SOURCEDIR="$( dirname "${BASH_SOURCE[0]}" )/";
local _TOOLSDIR="${_SOURCEDIR}sources/";
local _CURRENT_DIR="$( pwd )/";
local _DEPENDENCY_LIST=("WPUBaseAdminDatas" "WPUBaseAdminPage" "WPUBaseCron" "WPUBaseMessages" "WPUBaseSettings" "WPUBaseUpdate" "WPUBaseFields" "WPUBaseEmail" "WPUBaseToolbox" "WPUBaseFileCache");
###################################
## Initial
###################################
. "${_SOURCEDIR}bin/create/functions.sh";
###################################
## Test submodules
###################################
if [[ ! -f "${_TOOLSDIR}BashUtilities/README.md" || ! -f "${_TOOLSDIR}wpubaseplugin/README.md" ]]; then
cd "${_SOURCEDIR}";
git submodule update --init --recursive;
cd "${_CURRENT_DIR}";
fi;
###################################
## Install WP-Cli
###################################
local _WPCLISRC="${_SOURCEDIR}wp-cli.phar";
if [ ! -f "${_WPCLISRC}" ]; then
wpuplugincreator_install_wpcli;
fi;
function wpuplugincreator_wpcli_command(){
php "${_WPCLISRC}" $@;
}
###################################
## Tools
###################################
. "${_TOOLSDIR}BashUtilities/modules/files.sh";
. "${_TOOLSDIR}BashUtilities/modules/messages.sh";
. "${_TOOLSDIR}BashUtilities/modules/texttransform.sh";
. "${_TOOLSDIR}BashUtilities/modules/values.sh";
. "${_TOOLSDIR}BashUtilities/modules/git.sh";
###################################
## Functions
###################################
. "${_SOURCEDIR}bin/autocomplete.sh";
###################################
## Start tool
###################################
case "${1}" in
'upgrade-wpubaseplugin' )
. "${_SOURCEDIR}bin/${1}.sh";
;;
'add' | 'plugin-check' | 'regenerate-lang' | 'self-update' )
. "${_SOURCEDIR}bin/find-folder.sh";
. "${_SOURCEDIR}bin/${1}.sh";
;;
'update')
. "${_SOURCEDIR}bin/find-folder.sh";
. "${_SOURCEDIR}bin/update.sh";
. "${_SOURCEDIR}bin/regenerate-lang.sh";
;;
'create')
. "${_SOURCEDIR}bin/check-create.sh";
. "${_SOURCEDIR}bin/questions.sh";
. "${_SOURCEDIR}bin/create.sh";
;;
'src' )
cd "${_SOURCEDIR}";
;;
'help' | *)
. "${_SOURCEDIR}bin/help.sh";
;;
esac
. "${_SOURCEDIR}bin/stop.sh";
. "${_TOOLSDIR}BashUtilities/modules/stop.sh";
}
WPUPluginCreator "$@";