Skip to content

Commit

Permalink
sindresorhus#66 - fix for linux output processing
Browse files Browse the repository at this point in the history
  • Loading branch information
igorokb committed Apr 2, 2020
1 parent 430e6ef commit f8c4116
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/linux.js
Expand Up @@ -17,10 +17,12 @@ const processOutput = output => {

for (const row of output.trim().split('\n')) {
if (row.includes('=')) {
const [key, value] = row.split('=');
const [key, ...valueParts] = row.split('=');
const value = valueParts.join('=');
result[key.trim()] = value.trim();
} else if (row.includes(':')) {
const [key, value] = row.split(':');
const [key, ...valueParts] = row.split(':');
const value = valueParts.join(':');
result[key.trim()] = value.trim();
}
}
Expand Down

0 comments on commit f8c4116

Please sign in to comment.