-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix scanning on Linux #5
base: master
Are you sure you want to change the base?
Conversation
@@ -59,7 +59,7 @@ class EdidReader { | |||
// Linux fetch EDID | |||
getLinuxSystemEdids() { | |||
// /sys/devices/pci0000\:00/0000\:00\:02.0/drm/card0/card0-HDMI-A-1/edid | |||
return glob('/sys/devices/pci*/0000:*/drm/card*/card*/edid') | |||
return glob('/sys/devices/pci*/0000:*/*/drm/card*/card*/edid') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For local usage I added changes you've added to fix the error, however this line causes glob to not match any files, not sure if you added it for a reason, but I removed it and only then it matched the files needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's depending on the OS ?
@leMaik on which OS did you try this ?
The **
pattern can help in this case, to cover both possibilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this made it work on Ubuntu for me back then so… 🤷♂️ Maybe …/0000:**/drm/card…
would work for both of us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leMaik
I just tested it, it's of with the ** pattern, can you edit to :
return glob('/sys/devices/pci*/0000:*/**/drm/card*/card*/edid')
@@ -59,7 +59,7 @@ class EdidReader { | |||
// Linux fetch EDID | |||
getLinuxSystemEdids() { | |||
// /sys/devices/pci0000\:00/0000\:00\:02.0/drm/card0/card0-HDMI-A-1/edid | |||
return glob('/sys/devices/pci*/0000:*/drm/card*/card*/edid') | |||
return glob('/sys/devices/pci*/0000:*/*/drm/card*/card*/edid') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's depending on the OS ?
@leMaik on which OS did you try this ?
The **
pattern can help in this case, to cover both possibilities.
This PR fixes scanning not working on Linux (fixes #4), removes debug output and changes the json
require
calls to not use__dirname
.require
is always relative to the script's directory, so this isn't needed.Background: I use this in an application that is bundled to an executable with pkg, which doesn't work for dynamic
require
calls.PS: If someone needs this right now:
npm i -S @wertarbyte/edid-reader