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:
parent
8ee614d3f8
commit
739f3cd90b
@ -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 linux {
|
||||
$if android {
|
||||
$if termux {
|
||||
if os.getenv('TERMUX_VERSION') != '' {
|
||||
return .termux
|
||||
}
|
||||
$if android {
|
||||
return .android
|
||||
}
|
||||
$if linux {
|
||||
return .linux
|
||||
}
|
||||
$if ios {
|
||||
|
Loading…
Reference in New Issue
Block a user