mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-24 12:33:34 +03:00
Add support for lsb-release in detect_os (fixes #24)
This commit is contained in:
parent
187846c7d7
commit
318bfeca54
@ -5,9 +5,9 @@ function _tide_detect_os
|
||||
case freebsd openbsd dragonfly
|
||||
set -g _tide_os_icon
|
||||
case linux
|
||||
if _tide_detect_os_linux_cases (_tide_detect_os_extract_os_release_info ID)
|
||||
else if test "$tide_os_use_nearest" = 'true' &&
|
||||
_tide_detect_os_linux_cases (_tide_detect_os_extract_os_release_info ID_LIKE)
|
||||
if _tide_detect_os_linux_cases (_tide_detect_os_get_info /etc/os-release ID)
|
||||
else if _tide_detect_os_linux_cases (_tide_detect_os_get_info /etc/os-release ID_LIKE)
|
||||
else if _tide_detect_os_linux_cases (_tide_detect_os_get_info /etc/lsb-release DISTRIB_ID)
|
||||
else
|
||||
set -g _tide_os_icon
|
||||
end
|
||||
@ -50,9 +50,11 @@ function _tide_detect_os_linux_cases -a name
|
||||
return 0 # If we didn't run into the catch case '*', then return succesfull
|
||||
end
|
||||
|
||||
function _tide_detect_os_extract_os_release_info -a key
|
||||
set -l splitOsRelease (cat /etc/os-release | string split '=')
|
||||
function _tide_detect_os_get_info -a file key
|
||||
if test -e $file
|
||||
set -l splitOsRelease (cat $file | string split '=')
|
||||
set -l value $splitOsRelease[(math (contains --index $key $splitOsRelease)+1)]
|
||||
|
||||
string trim --chars='"' $value | string lower
|
||||
end
|
||||
end
|
||||
|
@ -42,7 +42,6 @@ tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color 444444
|
||||
tide_os_color EEEEEE
|
||||
tide_os_use_nearest true
|
||||
tide_print_newline_before_prompt 'true'
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color FF0000
|
||||
|
@ -42,7 +42,6 @@ tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color normal
|
||||
tide_os_color normal
|
||||
tide_os_use_nearest true
|
||||
tide_print_newline_before_prompt 'true'
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color FF0000
|
||||
|
@ -42,7 +42,6 @@ tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color normal
|
||||
tide_os_color normal
|
||||
tide_os_use_nearest true
|
||||
tide_print_newline_before_prompt 'true'
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color red
|
||||
|
@ -42,7 +42,6 @@ tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color CED7CF
|
||||
tide_os_color 080808
|
||||
tide_os_use_nearest true
|
||||
tide_print_newline_before_prompt 'true'
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color FF0000
|
||||
|
Loading…
Reference in New Issue
Block a user