-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathos-name.node.txt
28 lines (22 loc) · 1.71 KB
/
os-name.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
┏━━━━━━━━━━━━━┓
┃ OS-NAME ┃
┗━━━━━━━━━━━━━┛
VERSION ==> #6.0.0
OS-NAME(["PLATFORM"][, "SEMVER"]) #Returns human-friendly current OS and its version:
->STR # - Linux: "Linux 3.11"
# - Mac: "MacOS|OS X 10.14" (uses MACOS-RELEASE)
# - Windows: "Windows 10" (uses WINDOWS-RELEASE)
# - others: OS.platform()
#Def "PLATFORM" is OS.platform(), "SEMVER" is OS.release()
os-name #CLI
#Version 3.0.0
WINDOWS-RELEASE(["SEMVER"])->STR #From Windows version "SEMVER" (def: OS.release(), e.g. "10.0.17763") to STR:
# - '95', '98', 'ME', '2000', 'XP', 'Server 2003|2008|2012|2016|2019|2022', 'Vista', '7|8|8.1|10'
#Perform 'wmic os get Caption' to know whether Windows server or not, unless "SEMVER" is
# - on Windows 10, perform 'powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption' instead
#explicit and current OS is not Windows
#Version 6.0.1
MACOS-RELEASE(["SEMVER"])->OBJ #From Mac OS version "SEMVER" (def: OS.release(), e.g. '18.0.0') to OBJ:
# - name STR (e.g. "Mojave")
# - version 'NUM[.NUM2]' (e.g. "13" or "10.14")
#Version 3.3.0