mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00: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:
		
				
					committed by
					
						
						Dave Conway-Jones
					
				
			
			
				
	
			
			
			
						parent
						
							3e3b9aa706
						
					
				
				
					commit
					d9c551c026
				
			@@ -1,7 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "node-red-node-sensortag",
 | 
			
		||||
    "description": "A Node-RED node to read data from a TI SensorTag",
 | 
			
		||||
    "version": "0.0.16",
 | 
			
		||||
    "version": "0.0.17",
 | 
			
		||||
    "keywords": [
 | 
			
		||||
        "node-red",
 | 
			
		||||
        "sensortag",
 | 
			
		||||
@@ -12,7 +12,7 @@
 | 
			
		||||
        "sensortag": "~1.2.0"
 | 
			
		||||
    },
 | 
			
		||||
    "scripts" : {
 | 
			
		||||
        "postinstall" : "scripts/pibt.sh"
 | 
			
		||||
        "postinstall" : "node scripts/checkplatform.js pibt.sh"
 | 
			
		||||
    },
 | 
			
		||||
    "license": "Apache-2.0",
 | 
			
		||||
    "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
 | 
			
		||||
if grep -q ARM /proc/cpuinfo
 | 
			
		||||
then
 | 
			
		||||
    sudo apt-get install libbluetooth-dev libudev-dev pi-bluetooth
 | 
			
		||||
    sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
 | 
			
		||||
fi
 | 
			
		||||
#sudo apt-get install libbluetooth-dev libudev-dev pi-bluetooth
 | 
			
		||||
 sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user