Refactor OS detection
Darwin is merged with FreeBSD as all Darwin implementation are already delegating to FreeBSD implementations.
This commit is contained in:
parent
78b9aff683
commit
1f21d7ff5e
21
liquidprompt
21
liquidprompt
@ -69,13 +69,12 @@ fi
|
||||
###############
|
||||
|
||||
# LP_OS detection, default to Linux
|
||||
LP_OS="Linux"
|
||||
case $(uname) in
|
||||
"Linux" ) LP_OS="Linux" ;;
|
||||
"FreeBSD") LP_OS="FreeBSD" ;;
|
||||
"Darwin") LP_OS="Darwin" ;;
|
||||
"DragonFly") LP_OS="FreeBSD" ;;
|
||||
"SunOS") LP_OS="SunOS" ;;
|
||||
FreeBSD) LP_OS=FreeBSD ;;
|
||||
DragonFly) LP_OS=FreeBSD ;;
|
||||
Darwin) LP_OS=FreeBSD ;;
|
||||
SunOS) LP_OS=SunOS ;;
|
||||
*) LP_OS=Linux ;;
|
||||
esac
|
||||
|
||||
# Colors declarations
|
||||
@ -156,11 +155,6 @@ _lp_cpunum_FreeBSD()
|
||||
sysctl -n hw.ncpu
|
||||
}
|
||||
|
||||
_lp_cpunum_Darwin()
|
||||
{
|
||||
_lp_cpunum_FreeBSD
|
||||
}
|
||||
|
||||
_lp_cpunum_SunOS()
|
||||
{
|
||||
kstat -m cpu_info | grep -c "module: cpu_info"
|
||||
@ -185,11 +179,6 @@ _lp_load_FreeBSD()
|
||||
echo -n "$load"
|
||||
}
|
||||
|
||||
_lp_load_Darwin()
|
||||
{
|
||||
_lp_load_FreeBSD
|
||||
}
|
||||
|
||||
_lp_load_SunOS()
|
||||
{
|
||||
local load
|
||||
|
Loading…
Reference in New Issue
Block a user