diff --git a/assets/hhs-icons.csv b/assets/hhs-icons.csv index ec11684b..80019775 100644 --- a/assets/hhs-icons.csv +++ b/assets/hhs-icons.csv @@ -18,6 +18,7 @@ Icon,Hex,Oct,Name,Bash ,F005,\xef\x80\x85,Star,Yes ,F62B,\xef\x98\xab,Success,Yes ,F400,\xef\x90\x80,Tip,Yes +,F0AC,\xef\x82\xac,Yes ,F418,\xef\x90\x98,Git Branch,No ,F07B,\xef\x81\xbb,Folder Closed,No ,F1FA,\xef\x87\xba,At,No diff --git a/bin/apps/bash/app-commons.bash b/bin/apps/bash/app-commons.bash index ac61ffaa..baa22dcb 100755 --- a/bin/apps/bash/app-commons.bash +++ b/bin/apps/bash/app-commons.bash @@ -48,11 +48,13 @@ function _app_cleanups_() { # @param $2 [Opt] : The exit message to be displayed. function quit() { + local msg="${*}" + exit_code=${1:-0} shift - [[ ${exit_code} -ne 0 && ${#} -ge 1 ]] && echo -en "${RED}${APP_NAME}: " 1>&2 - [[ ${#} -ge 1 ]] && echo -e "${*} ${NC}" 1>&2 + [[ ${exit_code} -ne 0 && ${#} -ge 1 ]] && echo -en "${RED}${ERROR_ICN} Fatal: ${APP_NAME} ${WHITE}${POINTER_ICN} " 1>&2 + [[ ${#} -ge 1 ]] && echo -e "${msg} ${NC}" 1>&2 [[ ${#} -gt 0 ]] && echo '' exit "${exit_code}" } diff --git a/bin/apps/bash/hhs-app/functions/web.bash b/bin/apps/bash/hhs-app/functions/web.bash index 91406f02..96ed049d 100644 --- a/bin/apps/bash/hhs-app/functions/web.bash +++ b/bin/apps/bash/hhs-app/functions/web.bash @@ -10,43 +10,51 @@ # # Copyright (c) 2024, HomeSetup team -# @purpose: Open a docsify version of the HomeSetup README. -function docsify() { - local docsify_url raw_content_url url - - docsify_url='https://docsify-this.net/?basePath=' - raw_content_url="${HHS_GITHUB_URL//github/raw.githubusercontent}/master&sidebar=true" - url="${docsify_url}${raw_content_url}" +# @purpose: Open the HomeSetup GitHub page. +function github() { - echo "${ORANGE}Opening HomeSetup docsify README from: ${url} ${NC}" - sleep 2 + local page_url="https://github.com/yorevs/homesetup" - __hhs_open "${url}" && quit 0 + echo -e "${BLUE}${GLOBE_ICN} Opening HomeSetup github page from: ${page_url}${ELLIPSIS_ICN}${NC}" + __hhs_open "${page_url}" && sleep 2 && quit 0 - quit 1 "Failed to open url \"${url}\" !" + quit 1 "Failed to open url: \"${page_url}\" !" } # @purpose: Open the HomeSetup GitHub project board. function board() { - local raw_content_url="${HHS_GITHUB_URL}/projects/1" + local page_url="${HHS_GITHUB_URL}/projects/1" - echo "${ORANGE}Opening HomeSetup board from: ${raw_content_url} ${NC}" - sleep 2 - __hhs_open "${raw_content_url}" && quit 0 + echo -e "${BLUE}${GLOBE_ICN} Opening HomeSetup board from: ${page_url}${ELLIPSIS_ICN}${NC}" + __hhs_open "${page_url}" && sleep 2 && quit 0 - quit 1 "Failed to open url \"${raw_content_url}\" !" + quit 1 "Failed to open url: \"${page_url}\" !" } # @purpose: Open the HomeSetup GitHub sponsors page. function sponsor() { - local raw_content_url="https://github.com/sponsors/yorevs" + local page_url="https://github.com/sponsors/yorevs" + + echo -e "${BLUE}${GLOBE_ICN} Opening HomeSetup sponsors page from: ${page_url}${ELLIPSIS_ICN}${NC}" + __hhs_open "${page_url}" && sleep 2 && quit 0 + + quit 1 "Failed to open url: \"${page_url}\" !" +} + +# @purpose: Open a docsify version of the HomeSetup README. +function docsify() { + + local docsify_url page_url github_url + + docsify_url='https://docsify-this.net/?basePath=' + github_url="${HHS_GITHUB_URL//github/raw.githubusercontent}/master&sidebar=true" + page_url="${docsify_url}${github_url}" - echo "${ORANGE}Opening HomeSetup sponsors page from: ${raw_content_url} ${NC}" - sleep 2 - __hhs_open "${raw_content_url}" && quit 0 + echo -e "${BLUE}${GLOBE_ICN} Opening HomeSetup docsify README from: ${page_url}${ELLIPSIS_ICN}${NC}" + __hhs_open "${page_url}" && sleep 2 && quit 0 - quit 1 "Failed to open url \"${raw_content_url}\" !" + quit 1 "Failed to open url: \"${page_url}\" !" } diff --git a/dotfiles/bash/bash_icons.bash b/dotfiles/bash/bash_icons.bash index c8fa9568..373565d3 100644 --- a/dotfiles/bash/bash_icons.bash +++ b/dotfiles/bash/bash_icons.bash @@ -29,6 +29,7 @@ ELLIPSIS_ICN="\xe2\x80\xa6" # … ERROR_ICN="\xe2\x9c\x98" # ✘ FAIL_ICN="\xef\x91\xa7" #  FUNC_ICN="\xef\x84\xa1" #  +GLOBE_ICN="\xef\x82\xac" #  HAND_PEACE_ICN='\xef\x89\x9b' #  HELP_ICN="\xef\x81\x99" #  OFF_SWITCH_ICN="\xef\x88\x84" # 