Update aquariusPlugin code

Jonathan Hodgson 7 years ago
parent 4cb7a4649b
commit 48c627f6bd
  1. 96
      bin/aquariusPlugin

@ -1,10 +1,19 @@
#!/bin/bash #!/bin/bash
# default to adding plugins
remove=false remove=false
# default to https plugins
ssh=false
# Cd to public html foder
cd ${PWD%/public_html*}/public_html cd ${PWD%/public_html*}/public_html
# Loop through arguments passed
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
-h|--help) -h|--help)
#Print help message
echo -e "Aquarius Plugin installer" echo -e "Aquarius Plugin installer"
echo -e "Adds submodules for commonly used plugins" echo -e "Adds submodules for commonly used plugins"
echo -e "You can string multiple plugins together" echo -e "You can string multiple plugins together"
@ -12,9 +21,12 @@ while test $# -gt 0; do
echo "" echo ""
echo -e "-h, --help \t\t\t\t Show this help text" echo -e "-h, --help \t\t\t\t Show this help text"
echo -e "-r, --remove \t\t\t\t Remove any plugins after this flag" echo -e "-r, --remove \t\t\t\t Remove any plugins after this flag"
echo ""
echo -e "yoast \t\t\t\t\t install yoast" echo -e "yoast \t\t\t\t\t install yoast"
echo -e "db-migrate \t\t\t\t install db-migrate" echo -e "db-migrate \t\t\t\t install db-migrate"
echo -e "cf7 \t\t\t\t\t install cf7" echo -e "cf7 \t\t\t\t\t install cf7"
echo -e "woo, woocommerce\t\t\t install woocommerce"
echo ""
echo -e "blocks, aquarius-blocks \t\t install aquarius blocks" echo -e "blocks, aquarius-blocks \t\t install aquarius blocks"
echo -e "clients, aquarius-clients \t\t install aquarius clients" echo -e "clients, aquarius-clients \t\t install aquarius clients"
echo -e "news, aquarius-news \t\t\t install aquarius news" echo -e "news, aquarius-news \t\t\t install aquarius news"
@ -26,17 +38,25 @@ while test $# -gt 0; do
exit 0 exit 0
;; ;;
-r|--remove) -r|--remove)
#start removing
remove=true remove=true
shift shift
;; ;;
-s|--ssh)
ssh=true
shift
;;
yoast) yoast)
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
echo "attempting to remove yoast" echo "attempting to remove yoast"
git-delete-submodule "wp-content/plugins/wordpress-seo" git-delete-submodule "wp-content/plugins/wordpress-seo"
else else
echo "attempting to add yoast" echo "attempting to add yoast"
git submodule add https://bitbucket.org/fellowshipproductionsltd/wordpress-seo.git wp-content/plugins/wordpress-seo if [ "$ssh" = true ]; then
git submodule git@bitbucket.org:fellowshipproductionsltd/wordpress-seo.git wp-content/plugins/wordpress-seo
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/wordpress-seo.git wp-content/plugins/wordpress-seo
fi
fi fi
shift shift
;; ;;
@ -44,7 +64,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/wp-migrate-db" git-delete-submodule "wp-content/plugins/wp-migrate-db"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/wp-migrate-db.git wp-content/plugins/wp-migrate-db if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/wp-migrate-db.git wp-content/plugins/wp-migrate-db
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/wp-migrate-db.git wp-content/plugins/wp-migrate-db
fi
fi fi
shift shift
;; ;;
@ -52,7 +76,23 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/contact-form-7" git-delete-submodule "wp-content/plugins/contact-form-7"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/contact-form-7.git wp-content/plugins/contact-form-7 if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/contact-form-7.git wp-content/plugins/contact-form-7
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/contact-form-7.git wp-content/plugins/contact-form-7
fi
fi
shift
;;
woocommerce|woo)
if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/woocommerce"
else
if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/woocommerce.git wp-content/plugins/woocommerce
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/woocommerce.git wp-content/plugins/woocommerce
fi
fi fi
shift shift
;; ;;
@ -60,7 +100,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/aquarius-blocks" git-delete-submodule "wp-content/plugins/aquarius-blocks"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-blocks.git wp-content/plugins/aquarius-blocks if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-blocks.git wp-content/plugins/aquarius-blocks
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-blocks.git wp-content/plugins/aquarius-blocks
fi
fi fi
shift shift
;; ;;
@ -68,7 +112,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/aquarius-clients" git-delete-submodule "wp-content/plugins/aquarius-clients"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-clients.git wp-content/plugins/aquarius-clients if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-clients.git wp-content/plugins/aquarius-clients
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-clients.git wp-content/plugins/aquarius-clients
fi
fi fi
shift shift
;; ;;
@ -76,7 +124,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/aquarius-news" git-delete-submodule "wp-content/plugins/aquarius-news"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-news.git wp-content/plugins/aquarius-news if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-news.git wp-content/plugins/aquarius-news
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-news.git wp-content/plugins/aquarius-news
fi
fi fi
shift shift
;; ;;
@ -84,7 +136,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/aquarius-people" git-delete-submodule "wp-content/plugins/aquarius-people"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-people.git wp-content/plugins/aquarius-people if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-people.git wp-content/plugins/aquarius-people
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-people.git wp-content/plugins/aquarius-people
fi
fi fi
shift shift
;; ;;
@ -92,7 +148,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/mu-plugins/aquarius-permissions" git-delete-submodule "wp-content/mu-plugins/aquarius-permissions"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-permissions.git wp-content/mu-plugins/aquarius-permissions if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-permissions.git wp-content/mu-plugins/aquarius-permissions
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-permissions.git wp-content/mu-plugins/aquarius-permissions
fi
fi fi
shift shift
;; ;;
@ -100,7 +160,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/aquarius-slider" git-delete-submodule "wp-content/plugins/aquarius-slider"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-slider.git wp-content/plugins/aquarius-slider if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-slider.git wp-content/plugins/aquarius-slider
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-slider.git wp-content/plugins/aquarius-slider
fi
fi fi
shift shift
;; ;;
@ -108,7 +172,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/aquarius-snippets" git-delete-submodule "wp-content/plugins/aquarius-snippets"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-snippets.git wp-content/plugins/aquarius-snippets if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-snippets.git wp-content/plugins/aquarius-snippets
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-snippets.git wp-content/plugins/aquarius-snippets
fi
fi fi
shift shift
;; ;;
@ -116,7 +184,11 @@ while test $# -gt 0; do
if [ "$remove" = true ]; then if [ "$remove" = true ]; then
git-delete-submodule "wp-content/plugins/aquarius-widgets" git-delete-submodule "wp-content/plugins/aquarius-widgets"
else else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-widgets.git wp-content/plugins/aquarius-widgets if [ "$ssh" = true ]; then
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-widgets.git wp-content/plugins/aquarius-widgets
else
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-widgets.git wp-content/plugins/aquarius-widgets
fi
fi fi
shift shift
;; ;;

Loading…
Cancel
Save