Farmbot-Web-App/install_frontend.sh

23 lines
616 B
Bash
Raw Normal View History

2016-09-22 10:12:27 -06:00
#!/bin/bash
2016-09-22 16:20:17 -06:00
CURRENT_DIR=$(pwd)
2016-09-27 15:33:06 -06:00
# Clone into a temp folder...
2016-09-22 10:12:27 -06:00
rm -rf /tmp/farmbot_frontend
mkdir /tmp/farmbot_frontend
2016-09-26 14:25:20 -06:00
git clone https://github.com/farmbot/farmbot-web-frontend.git /tmp/farmbot_frontend
cd /tmp/farmbot_frontend
2016-12-08 16:38:28 -07:00
if [ "$NPM_ADDON" ]; then
echo "NPM ADD ON DETECTED... INSTALLING"
npm install $NPM_ADDON --save 2>&1
fi
2016-09-27 15:16:19 -06:00
npm install 2>&1
2016-09-27 15:33:06 -06:00
# Make webpack executable and compile everything.
chmod +x node_modules/webpack/bin/webpack.js
npm run build 2>&1
cd $CURRENT_DIR
# Move it over to the rails /public directory and install deps
mkdir public/ -p
cp -R /tmp/farmbot_frontend/public/* public/