Skip to content

Commit

Permalink
fsSize: rw /snap issue fixed (linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhildebrandt committed Aug 5, 2023
1 parent 014d618 commit a0c41f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ function fsSize(drive, callback) {
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
return line.startsWith('/');
}).forEach((line) => {
osMounts[line.split(' ')[0]] = line.toLowerCase().indexOf('rw') >= 0;
osMounts[line.split(' ')[0]] = osMounts[line.split(' ')[0]] ?? false;

This comment has been minimized.

Copy link
@RATIONAL331

RATIONAL331 Aug 9, 2023

@sebhildebrandt
Hello, the code does not work in the node 10 version. Could it be possible to edit the following sentence? Or convert any ES5 sentence.
osMounts[line.split(' ')[0]] = osMounts[line.split(' ')[0]] ? osMounts[line.split(' ')[0]] : false;

if (line.toLowerCase().indexOf('/snap/') === -1) {
osMounts[line.split(' ')[0]] = ((line.toLowerCase().indexOf('rw,') >= 0 || line.toLowerCase().indexOf(' rw ') >= 0));
}
});
} catch (e) {
util.noop();
Expand Down
3 changes: 2 additions & 1 deletion lib/osinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ function getFQDN() {
util.noop();
}
}
} if (_freebsd || _openbsd || _netbsd) {
}
if (_freebsd || _openbsd || _netbsd) {
try {
const stdout = execSync('hostname 2>/dev/null');
fqdn = stdout.toString().split(os.EOL)[0];
Expand Down

1 comment on commit a0c41f5

@sebhildebrandt
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RATIONAL331 sorry!! Fixed it, Version 5.18-14 just published.

Please sign in to comment.