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 Aug 2, 2021
1 parent ea912e4 commit 9317c3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/linux.js
Original file line number Diff line number Diff line change
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 9317c3e

Please sign in to comment.