1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add RPi.GPIO lib test for ArchLinux

This commit is contained in:
Dave Conway-Jones 2016-07-28 18:20:18 +01:00
parent f484156d8e
commit 53ca3046b3

View File

@ -30,10 +30,16 @@ module.exports = function(RED) {
} }
try { try {
fs.statSync("/usr/share/doc/python-rpi.gpio"); fs.statSync("/usr/share/doc/python-rpi.gpio"); // test on Raspbian
// /usr/lib/python2.7/dist-packages/RPi/GPIO
} catch(err) { } catch(err) {
RED.log.warn(RED._("rpi-gpio.errors.libnotfound")); try {
throw "Warning : "+RED._("rpi-gpio.errors.libnotfound"); fs.statSync("/usr/lib/python2.7/site-packages/RPi/GPIO"); // test on Arch
}
catch(err) {
RED.log.warn(RED._("rpi-gpio.errors.libnotfound"));
throw "Warning : "+RED._("rpi-gpio.errors.libnotfound");
}
} }
if ( !(1 & parseInt((fs.statSync(gpioCommand).mode & parseInt("777", 8)).toString(8)[0]) )) { if ( !(1 & parseInt((fs.statSync(gpioCommand).mode & parseInt("777", 8)).toString(8)[0]) )) {