mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Fix SensorTag node on Windows (#246)
Fix windows install (or rather - only run the postinstall if on Linux) Thanks @hardillb
This commit is contained in:
parent
3e3b9aa706
commit
d9c551c026
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-sensortag",
|
"name": "node-red-node-sensortag",
|
||||||
"description": "A Node-RED node to read data from a TI SensorTag",
|
"description": "A Node-RED node to read data from a TI SensorTag",
|
||||||
"version": "0.0.16",
|
"version": "0.0.17",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"node-red",
|
"node-red",
|
||||||
"sensortag",
|
"sensortag",
|
||||||
@ -12,7 +12,7 @@
|
|||||||
"sensortag": "~1.2.0"
|
"sensortag": "~1.2.0"
|
||||||
},
|
},
|
||||||
"scripts" : {
|
"scripts" : {
|
||||||
"postinstall" : "scripts/pibt.sh"
|
"postinstall" : "node scripts/checkplatform.js pibt.sh"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
17
hardware/sensorTag/scripts/checkplatform.js
Normal file
17
hardware/sensorTag/scripts/checkplatform.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
var spawn = require('child_process').spawn;
|
||||||
|
|
||||||
|
if (process.argv.length === 3) {
|
||||||
|
var command = process.argv[2];
|
||||||
|
|
||||||
|
if (process.platform === 'linux') {
|
||||||
|
var dir = __dirname;
|
||||||
|
var script = spawn(dir + "/" + command);
|
||||||
|
script.on('close',function(code){
|
||||||
|
process.exit(code);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
@ -1,6 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if grep -q ARM /proc/cpuinfo
|
#sudo apt-get install libbluetooth-dev libudev-dev pi-bluetooth
|
||||||
then
|
sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
|
||||||
sudo apt-get install libbluetooth-dev libudev-dev pi-bluetooth
|
|
||||||
sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
|
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user