Merge pull request #217 from dylanaraps/distro_func

Moved getdistro to a seperate function take 2
This commit is contained in:
Dylan Araps 2016-04-05 01:02:10 +10:00
commit 695bd7401d

View file

@ -452,6 +452,9 @@ esac
# Distro {{{ # Distro {{{
getdistro () {
[ ! -z "$distro" ] && return
case "$os" in case "$os" in
"Linux" ) "Linux" )
if type -p lsb_release >/dev/null 2>&1; then if type -p lsb_release >/dev/null 2>&1; then
@ -511,10 +514,15 @@ esac
distro=${distro//+( )/ } distro=${distro//+( )/ }
ascii_distro="$distro" ascii_distro="$distro"
getdistro () {
# Get architecture # Get architecture
[ "$os_arch" == "on" ] && \ [ "$os_arch" == "on" ] && \
distro+=" $(uname -m)" distro+=" $(uname -m)"
[ "$osx_codename" == "off" ] && \
distro=${distro/${codename}/Mac OS X}
[ "$osx_buildversion" == "off" ] && \
distro=${distro/ ${osx_build}}
} }
@ -2886,27 +2894,13 @@ done
# }}} # }}}
# OS overides {{{
# Overide OS X codename
case "$osx_codename" in
"off") distro=${distro/${codename}/Mac OS X} ;;
esac
case "$osx_buildversion" in
"off") distro=${distro/ ${osx_build}} ;;
esac
# }}}
# Call Functions and Finish Up {{{ # Call Functions and Finish Up {{{
# Restore cursor and clear screen on ctrl+c # Restore cursor and clear screen on ctrl+c
trap 'printf "\033[?25h"; clear; exit' 2 trap 'printf "\033[?25h"; clear; exit' 2
# Get colors / bold getdistro
colors colors
bold bold