reformat Platform.kt file

This commit is contained in:
AmirHossein Abdolmotallebi 2024-08-11 03:50:37 +03:30
parent cba4991f42
commit 761908f579

View File

@ -11,6 +11,7 @@ sealed class Platform(val name: String) {
data object Linux : Desktop("Linux")
data object MacOS : Desktop("Mac")
}
override fun toString(): String {
return name
}
@ -25,12 +26,13 @@ sealed class Platform(val name: String) {
else -> null
}
}
fun fromExecutableFileExtension(fileExtension:String): Platform?{
return when(fileExtension.lowercase()){
"exe","msi"-> Desktop.Windows
"deb","rpm"-> Desktop.Linux
fun fromExecutableFileExtension(fileExtension: String): Platform? {
return when (fileExtension.lowercase()) {
"exe", "msi" -> Desktop.Windows
"deb", "rpm" -> Desktop.Linux
"dmg", "pkg" -> Desktop.MacOS
"apk"-> Android
"apk" -> Android
else -> null
}
}