fogine / udiskie-dmenu

Manage removable devices in couple of keystrokes!
MIT License
44 stars 4 forks source link

Error at launch #1

Closed tyjak closed 7 years ago

tyjak commented 7 years ago

Hello, I tried to install udiskie-dmenu with npm but I have this error when launching

/usr/lib/node_modules/udiskie-dmenu/udiskie-dmenu:133
        data.label = data.label.split(':')[1].trim();
                                             ^

TypeError: Cannot read property 'trim' of undefined
    at /usr/lib/node_modules/udiskie-dmenu/udiskie-dmenu:133:46
    at Array.forEach (<anonymous>)
    at parseUdiskieInfo (/usr/lib/node_modules/udiskie-dmenu/udiskie-dmenu:125:21)
    at /usr/lib/node_modules/udiskie-dmenu/udiskie-dmenu:23:23
    at /usr/lib/node_modules/udiskie-dmenu/udiskie-dmenu:192:16
    at ChildProcess.exithandler (child_process.js:263:7)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

When I do udiskie-info -C -2 -a -o '"label":"{ui_label}", "isLuks":"{is_luks}", "mountPath": "{mount_path}"' I have :

"label":"/dev/loop0: f086f8f9-ec62-4e02-8543-09ad28ffa084", "isLuks":"False", "mountPath": ""
"label":"/dev/loop1", "isLuks":"False", "mountPath": ""
"label":"/dev/sdb: APPLE SD Card Reader", "isLuks":"False", "mountPath": ""
"label":"/dev/sdb2: dccd0300-84d1-4a84-a894-e77cbcd1696a", "isLuks":"False", "mountPath": "/"
"label":"/dev/sdb3: 1becc90c-df6b-4f9c-a093-4db6c15e8693", "isLuks":"False", "mountPath": "/home"
"label":"/dev/sdb4: Divers", "isLuks":"False", "mountPath": ""

I have npm 5.5.1 installed and udiskie 1.7.1

Any idea ?

Thank you

fogine commented 7 years ago

I'm sorry for the late response @tyjak . I have been unsubscribed from the repository notifications for some reason.
The issue was caused by unhandled case where a device doesn't have any label assigned (/dev/loop1 in your case). This should be now fixed in the 0.3.0 release. Thank you for the report!