File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
templates/swift/Sources/DeviceInfo/Linux Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -32,24 +32,24 @@ class LinuxDeviceInfo {
32
32
machineId = getMachineId ( )
33
33
}
34
34
35
- private func getOsRelease( ) -> [ String : String ] {
35
+ private static func getOsRelease( ) -> [ String : String ] {
36
36
return tryReadKeyValues ( path: " /etc/os-release " )
37
37
}
38
38
39
- private func getLsbRelease( ) -> [ String : String ] {
39
+ private static func getLsbRelease( ) -> [ String : String ] {
40
40
return tryReadKeyValues ( path: " /etc/lsb-release " )
41
41
}
42
42
43
- private func getMachineId( ) -> String {
43
+ private static func getMachineId( ) -> String {
44
44
return tryReadValue ( path: " /etc/machine-id " ) !
45
45
}
46
46
47
- private func tryReadValue( path: String ) -> String ? {
47
+ private static func tryReadValue( path: String ) -> String ? {
48
48
let url = URL ( fileURLWithPath: path)
49
49
return try ! String ( contentsOf: url, encoding: . utf8)
50
50
}
51
51
52
- private func tryReadKeyValues( path: String ) -> [ String : String ] {
52
+ private static func tryReadKeyValues( path: String ) -> [ String : String ] {
53
53
let url = URL ( fileURLWithPath: path)
54
54
let string = try ! String ( contentsOf: url, encoding: . utf8)
55
55
let lines = string. components ( separatedBy: . newlines)
You can’t perform that action at this time.
0 commit comments