File tree 1 file changed +16
-4
lines changed
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,21 @@ private let _version = "2.26.0" // {x-release-please-version}
12
12
private let _platform : String ? = {
13
13
#if os(macOS)
14
14
return " macOS "
15
+ #elseif os(visionOS)
16
+ return " visionOS "
15
17
#elseif os(iOS)
16
- return " iOS "
17
- #elseif os(tvOS)
18
- return " tvOS "
18
+ #if targetEnvironment(macCatalyst)
19
+ return " macCatalyst "
20
+ #else
21
+ if #available( iOS 14 . 0 , * ) , ProcessInfo . processInfo. isiOSAppOnMac {
22
+ return " iOSAppOnMac "
23
+ }
24
+ return " iOS "
25
+ #endif
19
26
#elseif os(watchOS)
20
27
return " watchOS "
28
+ #elseif os(tvOS)
29
+ return " tvOS "
21
30
#elseif os(Android)
22
31
return " Android "
23
32
#elseif os(Linux)
@@ -31,7 +40,10 @@ private let _platform: String? = {
31
40
32
41
private let _platformVersion : String ? = {
33
42
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(Windows)
34
- ProcessInfo . processInfo. operatingSystemVersionString
43
+ let majorVersion = ProcessInfo . processInfo. operatingSystemVersion. majorVersion
44
+ let minorVersion = ProcessInfo . processInfo. operatingSystemVersion. minorVersion
45
+ let patchVersion = ProcessInfo . processInfo. operatingSystemVersion. patchVersion
46
+ return " \( majorVersion) . \( minorVersion) . \( patchVersion) "
35
47
#elseif os(Linux) || os(Android)
36
48
if let version = try ? String ( contentsOfFile: " /proc/version " ) {
37
49
version. trimmingCharacters ( in: . whitespacesAndNewlines)
You can’t perform that action at this time.
0 commit comments