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.
|
// 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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user