You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
210 lines
7.3 KiB
210 lines
7.3 KiB
8 years ago
|
#!/bin/bash
|
||
|
|
||
7 years ago
|
# default to adding plugins
|
||
8 years ago
|
remove=false
|
||
7 years ago
|
|
||
|
# default to https plugins
|
||
7 years ago
|
ssh=true
|
||
7 years ago
|
|
||
|
# Cd to public html foder
|
||
8 years ago
|
cd ${PWD%/public_html*}/public_html
|
||
7 years ago
|
|
||
7 years ago
|
function doWebpack(){
|
||
|
line="$1:\t{path: path.resolve(plugins,'aquarius-$1')},"
|
||
|
sed -i "/const aquariusPlugins/a $line" webpack/variables.js
|
||
|
}
|
||
|
|
||
7 years ago
|
# Loop through arguments passed
|
||
8 years ago
|
while test $# -gt 0; do
|
||
|
case "$1" in
|
||
|
-h|--help)
|
||
7 years ago
|
#Print help message
|
||
8 years ago
|
echo -e "Aquarius Plugin installer"
|
||
|
echo -e "Adds submodules for commonly used plugins"
|
||
|
echo -e "You can string multiple plugins together"
|
||
7 years ago
|
echo -e "e.g. aquarius-plugin blocks clients"
|
||
8 years ago
|
echo ""
|
||
|
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"
|
||
7 years ago
|
echo -e "-s, --ssh \t\t\t\t Adds the ssh version for the submodule url"
|
||
7 years ago
|
echo ""
|
||
8 years ago
|
echo -e "blocks, aquarius-blocks \t\t install aquarius blocks"
|
||
|
echo -e "clients, aquarius-clients \t\t install aquarius clients"
|
||
6 years ago
|
echo -e "locations, aquarius-locations \t\t install aquarius locations"
|
||
8 years ago
|
echo -e "news, aquarius-news \t\t\t install aquarius news"
|
||
|
echo -e "people, aquarius-people \t\t install aquarius people"
|
||
|
echo -e "permissions, aquarius-permissions \t install aquarius permissions into mu-plugins"
|
||
|
echo -e "slider, aquarius-slider \t\t install aquarius slider"
|
||
|
echo -e "snippets, aquarius-snippets \t\t install aquarius snippets"
|
||
|
echo -e "widgets, aquarius-widgets \t\t install aquarius widgets"
|
||
|
exit 0
|
||
|
;;
|
||
|
-r|--remove)
|
||
7 years ago
|
#start removing
|
||
8 years ago
|
remove=true
|
||
|
shift
|
||
|
;;
|
||
7 years ago
|
-s|--ssh)
|
||
|
ssh=true
|
||
|
shift
|
||
|
;;
|
||
7 years ago
|
--no-ssh)
|
||
|
ssh=false
|
||
|
shift
|
||
|
;;
|
||
8 years ago
|
aquarius-blocks|blocks)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/plugins/aquarius-blocks
|
||
8 years ago
|
git-delete-submodule "wp-content/plugins/aquarius-blocks"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/plugins/aquarius-blocks
|
||
7 years ago
|
doWebpack blocks
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
|
aquarius-clients|clients)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/plugins/aquarius-clients
|
||
8 years ago
|
git-delete-submodule "wp-content/plugins/aquarius-clients"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/plugins/aquarius-clients
|
||
7 years ago
|
doWebpack clients
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
6 years ago
|
aquarius-locations|locations)
|
||
|
if [ "$remove" = true ]; then
|
||
|
npm remove wp-content/plugins/aquarius-locations
|
||
|
git-delete-submodule "wp-content/plugins/aquarius-locations"
|
||
|
else
|
||
|
if [ "$ssh" = true ]; then
|
||
|
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-locations.git wp-content/plugins/aquarius-locations
|
||
|
else
|
||
|
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-locations.git wp-content/plugins/aquarius-locations
|
||
|
fi
|
||
|
npm install --save wp-content/plugins/aquarius-locations
|
||
|
doWebpack locations
|
||
|
fi
|
||
|
shift
|
||
|
;;
|
||
8 years ago
|
aquarius-news|news)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/plugins/aquarius-news
|
||
8 years ago
|
git-delete-submodule "wp-content/plugins/aquarius-news"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/plugins/aquarius-news
|
||
7 years ago
|
doWebpack news
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
|
aquarius-people|people)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/plugins/aquarius-people
|
||
8 years ago
|
git-delete-submodule "wp-content/plugins/aquarius-people"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/plugins/aquarius-people
|
||
7 years ago
|
doWebpack people
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
|
aquarius-permissions|permissions)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/mu-plugins/aquarius-permissions
|
||
8 years ago
|
git-delete-submodule "wp-content/mu-plugins/aquarius-permissions"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/mu-plugins/aquarius-permissions
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
7 years ago
|
aquarius-projects|projects)
|
||
|
if [ "$remove" = true ]; then
|
||
|
npm remove wp-content/plugins/aquarius-slider
|
||
|
git-delete-submodule "wp-content/plugins/aquarius-projects"
|
||
|
else
|
||
|
if [ "$ssh" = true ]; then
|
||
|
git submodule add git@bitbucket.org:fellowshipproductionsltd/aquarius-projects.git wp-content/plugins/aquarius-projects
|
||
|
else
|
||
|
git submodule add https://bitbucket.org/fellowshipproductionsltd/aquarius-projects.git wp-content/plugins/aquarius-projects
|
||
|
fi
|
||
|
npm install --save wp-content/plugins/aquarius-projects
|
||
7 years ago
|
doWebpack projects
|
||
7 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
8 years ago
|
aquarius-slider|slider)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/plugins/aquarius-slider
|
||
8 years ago
|
git-delete-submodule "wp-content/plugins/aquarius-slider"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/plugins/aquarius-slider
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
|
aquarius-snippets|snippets)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/plugins/aquarius-snippets
|
||
8 years ago
|
git-delete-submodule "wp-content/plugins/aquarius-snippets"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/plugins/aquarius-snippets
|
||
7 years ago
|
doWebpack snippets
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
|
aquarius-widgets|widgets)
|
||
|
if [ "$remove" = true ]; then
|
||
7 years ago
|
npm remove wp-content/plugins/aquarius-widgets
|
||
8 years ago
|
git-delete-submodule "wp-content/plugins/aquarius-widgets"
|
||
|
else
|
||
7 years ago
|
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
|
||
7 years ago
|
npm install --save wp-content/plugins/aquarius-widgets
|
||
7 years ago
|
doWebpack widgets
|
||
8 years ago
|
fi
|
||
|
shift
|
||
|
;;
|
||
|
*)
|
||
|
echo "Unknown plugin $1"
|
||
|
exit 0
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
done
|