Skip to content

Commit

Permalink
Merge pull request #18 from kimlimjustin/master
Browse files Browse the repository at this point in the history
Prevent space splitting break the disk name
  • Loading branch information
Cristiam Mercado authored Apr 30, 2021
2 parents f0ee9cf + c11e701 commit cd74356
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/platforms/darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var Darwin = /** @class */ (function () {
if (value !== '') {
var line = value.replace(/ +(?= )/g, '');
var tokens = line.split(' ');
tokens[5] = tokens.slice(5).join(' ') // Prevent space splitting break the disk name
var d = new drive_1.default(tokens[0], isNaN(parseFloat(tokens[1])) ? 0 : +tokens[1], isNaN(parseFloat(tokens[2])) ? 0 : +tokens[2], isNaN(parseFloat(tokens[3])) ? 0 : +tokens[3], tokens[4], tokens[5]);
drives.push(d);
}
Expand Down
1 change: 1 addition & 0 deletions dist/platforms/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var Linux = /** @class */ (function () {
if (value !== '') {
var line = value.replace(/ +(?= )/g, '');
var tokens = line.split(' ');
tokens[5] = tokens.slice(5).join(' ') // Prevent space splitting break the disk name
var d = new drive_1.default(tokens[0], isNaN(parseFloat(tokens[1])) ? 0 : +tokens[1], isNaN(parseFloat(tokens[2])) ? 0 : +tokens[2], isNaN(parseFloat(tokens[3])) ? 0 : +tokens[3], tokens[4], tokens[5]);
drives.push(d);
}
Expand Down

0 comments on commit cd74356

Please sign in to comment.