fix unicorn hat command check

This commit is contained in:
Dave Conway-Jones 2018-04-18 17:44:47 +01:00
parent f033a383b9
commit 8f17072176
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pi-unicorn-hat",
"version" : "0.0.17",
"version" : "0.0.18",
"description" : "A Node-RED node to output to a Raspberry Pi Unicorn HAT from Pimorini.",
"dependencies" : {
"pngjs": "2.2.*"

View File

@ -7,7 +7,7 @@ module.exports = function(RED) {
var execSync = require('child_process').execSync;
var hatCommand = __dirname+'/unihat';
var allOK = true;
var allOK = true;
try {
var cpuinfo = fs.readFileSync("/proc/cpuinfo").toString();
@ -19,7 +19,7 @@ module.exports = function(RED) {
RED.log.warn("rpi-unicorn : "+RED._("node-red:rpi-gpio.errors.libnotfound"));
allOK = false;
}
else if (!(1 & parseInt ((fs.statSync(gpioCommand).mode & parseInt ("777", 8)).toString (8)[0]))) {
else if (!(1 & parseInt ((fs.statSync(hatCommand).mode & parseInt ("777", 8)).toString (8)[0]))) {
RED.log.warn("rpi-unicorn : "+RED._("node-red:rpi-gpio.errors.needtobeexecutable",{command:hatCommand}));
allOK = false;
}