mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
bin/updatePlugins.sh: Many refinements
* cd to top-level Etherpad directory is now more robust. * Only attempt to update packages whose names begin with `ep_`. * Don't create `package-lock.json`. * Improve logging. * Improve error handling.
This commit is contained in:
parent
4b3e47bd23
commit
7bdd0f2f09
1 changed files with 10 additions and 19 deletions
|
@ -1,20 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
#Move to the folder where ep-lite is installed
|
mydir=$(cd "${0%/*}" && pwd -P) || exit 1
|
||||||
cd $(dirname $0)
|
cd "${mydir}"/../..
|
||||||
|
OUTDATED=$(npm outdated --depth=0 | awk '{print $1}' | grep '^ep_') || {
|
||||||
#Was this script started in the bin folder? if yes move out
|
echo "All plugins are up-to-date"
|
||||||
if [ -d "../bin" ]; then
|
exit 0
|
||||||
cd "../"
|
}
|
||||||
fi
|
set -- ${OUTDATED}
|
||||||
|
echo "Updating plugins: $*"
|
||||||
# npm outdated --depth=0 | grep -v "^Package" | awk '{print $1}' | xargs npm install $1 --save-dev
|
exec npm install --no-save "$@"
|
||||||
OUTDATED=$(npm outdated --depth=0 | grep -v "^Package" | awk '{print $1}')
|
|
||||||
# echo $OUTDATED
|
|
||||||
if test -n "$OUTDATED"; then
|
|
||||||
echo "Plugins require update, doing this now..."
|
|
||||||
echo "Updating $OUTDATED"
|
|
||||||
npm install $OUTDATED --save-dev
|
|
||||||
else
|
|
||||||
echo "Plugins are all up to date"
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in a new issue