Skip to content

Commit

Permalink
feat: Add /dev name support
Browse files Browse the repository at this point in the history
  • Loading branch information
jhinrichsen committed Jan 3, 2016
1 parent 4ee15d4 commit 421a5cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const fsp = require('fs-promise'),
return p;
},

// Return a /dev/<device> 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)
Expand All @@ -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 {
Expand Down

0 comments on commit 421a5cb

Please sign in to comment.