feat(constraints): gui 判断增加 MacOS
This commit is contained in:
parent
477a579044
commit
91efeb74b8
@ -21,15 +21,23 @@ module os {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export use os
|
||||||
|
|
||||||
# 图形界面约束
|
# 图形界面约束
|
||||||
export def gui [] {
|
export def gui [] {
|
||||||
use pkg.nu
|
use pkg.nu
|
||||||
|
|
||||||
pkg check_install? libxrandr
|
if (os linux) {
|
||||||
|
# Linux 暂时只考虑 X11
|
||||||
|
pkg check_install? libxrandr
|
||||||
|
} else if (os darwin) {
|
||||||
|
# MacOS 都是图形界面
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export use os
|
|
||||||
|
|
||||||
# 获得默认的约束
|
# 获得默认的约束
|
||||||
export def default_constraints [] {
|
export def default_constraints [] {
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user