From 421a5cb0c1071560f49a96e32e3489da92879953 Mon Sep 17 00:00:00 2001 From: "Jochen Hinrichsen @ pi2" Date: Sun, 3 Jan 2016 16:49:01 +0000 Subject: [PATCH] feat: Add /dev name support --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9f36303..144a9ad 100644 --- a/index.js +++ b/index.js @@ -29,6 +29,9 @@ const fsp = require('fs-promise'), return p; }, + // Return a /dev/ name for a given framebuffer + devname = path => `/dev/${path.split('/').reverse()[0]}`, + // Returns an Optional, which is also called a Maybe in other languages fb = prospects.then(a => { let r = Stream(a) @@ -40,7 +43,7 @@ const fsp = require('fs-promise'), rc = fb.then(a => { if (a.isPresent()) { - const led = a.get(); + const led = devname(a.get()); console.log(`Found framebuffer ${led}`); return led; } else {