yunkong2.js-controller/reinstall.sh

34 lines
709 B
Bash
Raw Normal View History

2018-09-17 20:32:19 +08:00
#!/bin/bash
yunkong2 stop
BASE=$(pwd)
if [ ! -f "$BASE/yunkong2" ]
then
echo "Script needs to be started in the yunkong2 base directory (normally /opt/yunkong2 on linux)"
exit
fi
if [ -d ./node_modules ]
then
ls -1 ./node_modules | grep yunkong2. > reinstall.list.txt
chmod -R 777 *
cd node_modules
rm -R *
pwd
while read IN
do
npm install $IN --production --save --unsafe-perm --prefix $BASE
if [ $? -eq 0 ]
then
echo "DONE $IN"
else
echo "FAIL $IN"
fi
done < "$BASE/reinstall.list.txt"
chmod -R 777 *
rm "$BASE/reinstall.list.txt"
yunkong2 upload all
fi