added wildcards for gnu/darwin detection

This commit is contained in:
pyr0ball 2022-10-28 10:42:46 -07:00
parent 4536a6ebaa
commit 173af8fb95

View file

@ -14,8 +14,8 @@ ESC=$( printf '\033')
# Detect OS type # Detect OS type
case $OSTYPE in case $OSTYPE in
linux-gnu ) ESC=$( printf '\033') ;; linux-gnu* ) ESC=$( printf '\033') ;;
darwin ) ESC=$( printf '\e') ;; darwin* ) ESC=$( printf '\e') ;;
cygwin ) ESC=$( printf '\033') ;; cygwin ) ESC=$( printf '\033') ;;
msys ) ESC=$( printf '\033') ;; msys ) ESC=$( printf '\033') ;;
esac esac
@ -73,7 +73,7 @@ fi
# Extra Unicode Character Manipulation # Extra Unicode Character Manipulation
case $OSTYPE in case $OSTYPE in
linux-gnu ) linux-gnu* )
return_arrow=$(echo -e "\u2BAC") return_arrow=$(echo -e "\u2BAC")
enter_arrow=$(echo -e "\u21B5") enter_arrow=$(echo -e "\u21B5")
green_check=${grn}$(echo -e "\u2714")${dfl} green_check=${grn}$(echo -e "\u2714")${dfl}
@ -81,7 +81,7 @@ case $OSTYPE in
selected_opt=$(echo -e "\u25C9") selected_opt=$(echo -e "\u25C9")
deselected_opt=$(echo -e "\u25CE") deselected_opt=$(echo -e "\u25CE")
;; ;;
darwin ) darwin* )
return_arrow=$(echo -e "⮬") return_arrow=$(echo -e "⮬")
enter_arrow=$(echo -e "↵") enter_arrow=$(echo -e "↵")
green_check=${grn}$(echo -e "✔")${dfl} green_check=${grn}$(echo -e "✔")${dfl}
@ -117,7 +117,7 @@ fi
# Box Drawing characters # Box Drawing characters
case $OSTYPE in case $OSTYPE in
linux-gnu ) linux-gnu* )
light_h=$(echo -e "\u2500") light_h=$(echo -e "\u2500")
norm_h=$(echo -e "\u2501") norm_h=$(echo -e "\u2501")
double_h=$(echo -e "\u2550") double_h=$(echo -e "\u2550")
@ -125,7 +125,7 @@ case $OSTYPE in
norm_v=$(echo -e "\u2503") norm_v=$(echo -e "\u2503")
double_v=$(echo -e "\u2551") double_v=$(echo -e "\u2551")
;; ;;
darwin ) darwin* )
light_h=$(echo -e "─") light_h=$(echo -e "─")
norm_h=$(echo -e "━") norm_h=$(echo -e "━")
double_h=$(echo -e "═") double_h=$(echo -e "═")
@ -157,7 +157,7 @@ esac
box-norm(){ box-norm(){
# ---------------------------------------# # ---------------------------------------#
case $OSTYPE in case $OSTYPE in
linux-gnu ) linux-gnu* )
top_border=${norm_h} top_border=${norm_h}
bottom_border=${norm_h} bottom_border=${norm_h}
left_border=${norm_v} left_border=${norm_v}
@ -168,7 +168,7 @@ box-norm(){
right_bottom_border=$(echo -e "\u251b") right_bottom_border=$(echo -e "\u251b")
box_break_line=$(echo -e "\u25AB") box_break_line=$(echo -e "\u25AB")
;; ;;
darwin ) darwin* )
top_border=${norm_h} top_border=${norm_h}
bottom_border=${norm_h} bottom_border=${norm_h}
left_border=${norm_v} left_border=${norm_v}
@ -210,7 +210,7 @@ box-norm(){
box-double(){ box-double(){
# ---------------------------------------# # ---------------------------------------#
case $OSTYPE in case $OSTYPE in
linux-gnu ) linux-gnu* )
top_border=${double_h} top_border=${double_h}
bottom_border=${double_h} bottom_border=${double_h}
left_border=${double_v} left_border=${double_v}
@ -221,7 +221,7 @@ box-double(){
right_bottom_border=$(echo -e "\u255D") right_bottom_border=$(echo -e "\u255D")
box_break_line=$(echo -e "\u25AB") box_break_line=$(echo -e "\u25AB")
;; ;;
darwin ) darwin* )
top_border=${double_h} top_border=${double_h}
bottom_border=${double_h} bottom_border=${double_h}
left_border=${double_v} left_border=${double_v}
@ -262,7 +262,7 @@ box-double(){
box-heavy(){ box-heavy(){
# ---------------------------------------# # ---------------------------------------#
case $OSTYPE in case $OSTYPE in
linux-gnu ) linux-gnu* )
top_border=$(echo -e "\u2580") top_border=$(echo -e "\u2580")
bottom_border=$(echo -e "\u2584") bottom_border=$(echo -e "\u2584")
left_border=$(echo -e "\u258C") left_border=$(echo -e "\u258C")
@ -273,7 +273,7 @@ box-heavy(){
right_bottom_border=$(echo -e "\u259F") right_bottom_border=$(echo -e "\u259F")
box_break_line=$(echo -e "\u25AC") box_break_line=$(echo -e "\u25AC")
;; ;;
darwin ) darwin* )
top_border=$(echo -e "▀") top_border=$(echo -e "▀")
bottom_border=$(echo -e "▄") bottom_border=$(echo -e "▄")
left_border=$(echo -e "▌") left_border=$(echo -e "▌")
@ -315,7 +315,7 @@ box-light(){
# ---------------------------------------# # ---------------------------------------#
#top_border=$(echo -e '\u23BA') #top_border=$(echo -e '\u23BA')
case $OSTYPE in case $OSTYPE in
linux-gnu ) linux-gnu* )
top_border=${light_h} top_border=${light_h}
bottom_border=${light_h} bottom_border=${light_h}
left_border=${light_v} left_border=${light_v}
@ -326,7 +326,7 @@ box-light(){
right_bottom_border=$(echo -e "\u23CC") right_bottom_border=$(echo -e "\u23CC")
box_break_line=$(echo -e "\u23AF") box_break_line=$(echo -e "\u23AF")
;; ;;
darwin ) darwin* )
top_border=${light_h} top_border=${light_h}
bottom_border=${light_h} bottom_border=${light_h}
left_border=${light_v} left_border=${light_v}
@ -366,7 +366,7 @@ box-light(){
box-rounded(){ box-rounded(){
# ---------------------------------------# # ---------------------------------------#
case $OSTYPE in case $OSTYPE in
linux-gnu ) linux-gnu* )
top_border=${light_h} top_border=${light_h}
bottom_border=${light_h} bottom_border=${light_h}
left_border=${light_v} left_border=${light_v}
@ -377,7 +377,7 @@ box-rounded(){
right_bottom_border=$(echo -e "\u256F") right_bottom_border=$(echo -e "\u256F")
box_break_line=$(echo -e "\u25A2") box_break_line=$(echo -e "\u25A2")
;; ;;
darwin ) darwin* )
top_border=${light_h} top_border=${light_h}
bottom_border=${light_h} bottom_border=${light_h}
left_border=${light_v} left_border=${light_v}