add add_extension script
This commit is contained in:
22
scripts/add_extension.sh
Normal file
22
scripts/add_extension.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
EXT_NAME=$1
|
||||
EXT_VERSION=$2
|
||||
|
||||
cd "${WIKI_SOURCE}/extensions"
|
||||
|
||||
if [[ -e "${EXT_NAME}" ]]; then
|
||||
cp -Rv "${EXT_NAME}" .
|
||||
cd "$(basename ${EXT_NAME})"
|
||||
else
|
||||
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/${EXT_NAME}"
|
||||
cd "${EXT_NAME}"
|
||||
fi
|
||||
|
||||
if [[ "${EXT_VERSION}" ]]; then
|
||||
git checkout -b "${EXT_VERSION}" "origin/${EXT_VERSION}"
|
||||
fi
|
||||
|
||||
if [[ -e "composer.json" ]]; then
|
||||
composer install --no-dev
|
||||
fi
|
Reference in New Issue
Block a user