Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
2 changed files with 14 additions and 0 deletions
Showing only changes of commit 64adc6cc86 - Show all commits

View File

@ -3,6 +3,7 @@
const restify = require('restify')
const log = require('./lib/log')('main')
const fs = require('fs')
const { exec } = require('child_process')
const BLE = require('./lib/ble')
const intval = require('./lib/intval')
@ -519,6 +520,10 @@ function seq () {
}
}
function update (req, res, next) {
exec('sh ./scripts/update.sh')
}
function index (req, res, next) {
fs.readFile(INDEXPATH, 'utf8', (err, data) => {
if (err) {

9
scripts/update.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
cd /home/pi/intval3
sudo -u pi -i<< EOF
git pull
EOF
sudo pm2 restart process.json