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