cristiammercado / node-disk-info

Node module to get disk information in Windows, Linux, Mac, FreeBSD & OpenBSD (works with Electron).
MIT License
60 stars 15 forks source link

Mounted name went wrong when there's a space on Linux and Darwin #17

Closed kimlimjustin closed 3 years ago

kimlimjustin commented 3 years ago

Mounted name of a disk when wrong when there's a space, in my case, New Volume become New. I've read the code and figured out this bug occurred because the code directly passed the tokens[5] which is an array came from splitting space in the line variable into the drive_1 class, and I found a way to fix it! I'd like to be assigned to fix this bug if you like to :)

Regards

Ekristoffe commented 3 years ago

Indeed, does this do the trick: Replace tokens[5] by this : const mount = tokens.slice(5).join(' ');

kimlimjustin commented 3 years ago

Indeed, does this do the trick: Replace tokens[5] by this : const mount = tokens.slice(5).join(' ');

Yeah, I figured it out and applied into my project, may I open an PR for this issue here?

Ekristoffe commented 3 years ago

yeah why not but I have a PR which may bother. anyway no need to ask you can just do it :)

kimlimjustin commented 3 years ago

yeah why not but I have a PR which may bother. anyway no need to ask you can just do it :)

Okay thanks!

Ekristoffe commented 3 years ago

18 was made in the dist files (compiled files) which mean each time someone will compile from source your fix would be lost.

I added them in the src folder and made #20