##!/bin/bash
##sh MAKEFILE
git pull origin master
apt-get update
npm install -g npm@latest
npm update
npm install
# audit Fix Auto and list modules
npm audit fix
npm list -g --depth 0
npm list
#
##  Verifies the contents of the cache folder, garbage collecting any unneeded data, and verifying the integrity of the cache index and all cached data
npm cache verify
#
# installations
#npm install webrtcdevelopment --unsafe-perm=true --allow-root
#ls -l -d node_modules/webrtcdevelopment/build/webrtcdevelopment_min*
##mv node_modules/webrtcdevelopment/build/webrtcdevelopment* dist/js/
#mv node_modules/webrtcdevelopment/build/*_min.js dist/js/
#mv node_modules/webrtcdevelopment/build/*_header.js dist/js/
#mv node_modules/webrtcdevelopment/build/*_min.css dist/css/
#mv node_modules/webrtcdevelopment/build/*_header.css dist/css/
##for i in $(find ./dist/js -name "*.js")
##do
##  sed -E 's/console.(log|debug|info|...|count)\((.*)\);?//g' $i > ${i}.copy && mv ${i}.copy $i
##done
#rm -rf node_modules/webrtcdevelopment
## remove logs
#rm /home/ubuntu/.npm/_logs/*
#echo "----done------"
#pm2 start ecosystem.config.js
#echo "----server started------"
#netstat -anp
#pm2 monit
#pm2 list
