Skip to content

Commit

Permalink
feat: Add OS version info to user agent for Linux & Windows (#738)
Browse files Browse the repository at this point in the history
* Add OS versions logic for Linux.

* Delete compiler directives; apple implemented these for us.

---------

Co-authored-by: Chan Yoo <[email protected]>
  • Loading branch information
sichanyoo and Chan Yoo authored May 24, 2024
1 parent fdc7a1b commit 129e98b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions Sources/ClientRuntime/Util/PlatformOperationSystemVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@
// SPDX-License-Identifier: Apache-2.0
//

#if os(iOS) || os(watchOS) || os(macOS) || os(tvOS)
import Foundation.NSProcessInfo
import class Foundation.ProcessInfo

public struct PlatformOperationSystemVersion {
static public func operatingSystemVersion() -> String? {
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
return "\(osVersion.majorVersion).\(osVersion.minorVersion).\(osVersion.patchVersion)"
}
}
#else
// TODO: Implement for Linux & Windows
public struct PlatformOperationSystemVersion {
static public func operatingSystemVersion() -> String? {
return nil
}
}
#endif

0 comments on commit 129e98b

Please sign in to comment.