Skip to content

Commit 6fc09f3

Browse files
drexinaciidgh
authored andcommitted
Add fedora to Platform.LinuxFlavor
1 parent bdb84aa commit 6fc09f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/TSCUtility/Platform.swift

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public enum Platform {
2020
/// Recognized flavors of linux.
2121
public enum LinuxFlavor {
2222
case debian
23+
case fedora
2324
}
2425

2526
/// Lazily checked current platform.
@@ -38,6 +39,11 @@ public enum Platform {
3839
localFileSystem.isFile(AbsolutePath("/system/bin/toybox")) {
3940
return .android
4041
}
42+
if localFileSystem.isFile(AbsolutePath("/etc/redhat-release")) ||
43+
localFileSystem.isFile(AbsolutePath("/etc/centos-release")) ||
44+
localFileSystem.isFile(AbsolutePath("/etc/fedora-release")) {
45+
return .linux(.fedora)
46+
}
4147
default:
4248
return nil
4349
}

0 commit comments

Comments
 (0)