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
1 changed files with 68 additions and 74 deletions

View File

@ -452,6 +452,9 @@ esac
# Distro {{{
getdistro () {
[ ! -z "$distro" ] && return
case "$os" in
"Linux" )
if type -p lsb_release >/dev/null 2>&1; then
@ -511,10 +514,15 @@ esac
distro=${distro//+( )/ }
ascii_distro="$distro"
getdistro () {
# Get architecture
[ "$os_arch" == "on" ] && \
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 {{{
# Restore cursor and clear screen on ctrl+c
trap 'printf "\033[?25h"; clear; exit' 2
# Get colors / bold
getdistro
colors
bold