Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fscherwi committed Sep 17, 2017
1 parent 07a580e commit c4119cf
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 12 deletions.
18 changes: 9 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
exports.get = function get() { /* istanbul ignore next */
if (process.platform === 'darwin') {
var release = parseFloat(require('os').release());
if (process.platform === "darwin") {
var release = parseFloat(require("os").release());
switch (release) {
case 1.3:
return "10.0";
case 1.4:
return "10.1";
default:
return "10." + Number((release - 4).toFixed(1));
case 1.3:
return "10.0";
case 1.4:
return "10.1";
default:
return "10." + (Number((release - 4).toFixed(1)) - 0.1);
}
} else {
return 'no Mac OS system';
return "no Mac OS system";
}
};
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "get-osx-version",
"version": "1.4.0",
"description": "small and tiny program to get your current OS X version",
"version": "1.4.1",
"description": "small and tiny program to get the current Mac OS version of the system",
"main": "main.js",
"scripts": {
"test": "node test.js",
Expand All @@ -15,7 +15,8 @@
"keywords": [
"osx",
"mac",
"version"
"version",
"mac os"
],
"author": "fscherwi",
"license": "MIT",
Expand Down

0 comments on commit c4119cf

Please sign in to comment.