forked from open-eio/opk-temper1-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·28 lines (27 loc) · 919 Bytes
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env node
var exec = require('child_process').exec;
console.log('Detecting environment.')
exec('which rpi-update', function(err, stdout, stderr) {
if (stdout) {
console.log('Installing for Raspbian...')
// We are on raspbian, try nonstandard install
var child = exec('cd ' + __dirname + '; npm install commander; cd node_modules; git clone https://github.com/rjsteinert/temper1x.raspbian.git; mv temper1x.raspbian temper1x;')
child.stdout.on('data', function(data) {
console.log(data)
})
child.stderr.on('data', function(data) {
console.log(data)
})
}
else {
console.log('Installing...')
// We are not on raspbian, try standard install
var child = exec('cd ' + __dirname + '; npm install;')
child.stdout.on('data', function(data) {
console.log(data)
})
child.stderr.on('data', function(data) {
console.log(data)
})
}
})