From 06ab7dd26c88e57d5da50acd4c6a3af77c89319d Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Thu, 21 May 2020 10:23:42 +0200 Subject: [PATCH] cpuTemperature() fix (BSD), code cleanup --- CHANGELOG.md | 1 + README.md | 2 +- docs/graphics.html | 2 +- docs/history.html | 5 +++++ docs/index.html | 2 +- lib/cpu.js | 2 +- lib/util.js | 40 ++++++++++++++++++++-------------------- 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ec0f79..98d36a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.26.4 | 2020-05-21 | `cpuTemperature()` fix (BSD), code cleanup | | 4.26.3 | 2020-05-20 | updated documentation (macOS temperature) | | 4.26.2 | 2020-05-19 | `processes()` memory leak fix | | 4.26.1 | 2020-05-13 | code cleanup | diff --git a/README.md b/README.md index aa64ee1..2b0d794 100644 --- a/README.md +++ b/README.md @@ -276,7 +276,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] ( | | ...[0].currentResY | X | | X | X | | current pixel vertical | | | ...[0].positionX | | | | X | | display position X | | | ...[0].positionY | | | | X | | display position Y | -| | ...[0].currentRefreshRate | X | | X | X | | current pixel vertical | +| | ...[0].currentRefreshRate | X | | X | X | | current screen refresh rate | #### 7. Operating System diff --git a/docs/graphics.html b/docs/graphics.html index 91e6d19..7616374 100644 --- a/docs/graphics.html +++ b/docs/graphics.html @@ -293,7 +293,7 @@ X - current refresh rate + current screen refresh rate diff --git a/docs/history.html b/docs/history.html index 4e67a1c..311e4e4 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.26.4 + 2020-05-21 + cpuTemperature() fix (BSD), code cleanup + 4.26.3 2020-05-20 diff --git a/docs/index.html b/docs/index.html index 813d28f..0709872 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.26.3
+
Current Version: 4.26.4
diff --git a/lib/cpu.js b/lib/cpu.js index 4507a4a..1dd4740 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -848,7 +848,7 @@ function cpuTemperature(callback) { let sum = 0; lines.forEach(function (line) { const parts = line.split(':'); - if (parts.length > 0) { + if (parts.length > 1) { const temp = parseFloat(parts[1].replace(',', '.')); if (temp > result.max) result.max = temp; sum = sum + temp; diff --git a/lib/util.js b/lib/util.js index e7a87dc..30b268c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -487,26 +487,26 @@ function countLines(lines, startingWith) { function sanitizeShellString(str) { let result = str; - result = result.replace(/>/g, ""); - result = result.replace(//g, ''); + result = result.replace(/