1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

pref: detect termux more reliably (#15001)

This commit is contained in:
Thomas Peißl 2022-07-09 16:23:19 +02:00 committed by GitHub
parent 8ee614d3f8
commit 739f3cd90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,8 @@
// that can be found in the LICENSE file.
module pref
import os
pub enum OS {
_auto // Reserved so .macos cannot be misunderstood as auto
ios
@ -91,13 +93,13 @@ pub fn (o OS) str() string {
}
pub fn get_host_os() OS {
if os.getenv('TERMUX_VERSION') != '' {
return .termux
}
$if android {
return .android
}
$if linux {
$if android {
$if termux {
return .termux
}
return .android
}
return .linux
}
$if ios {