Skip to content

Commit

Permalink
Adjustments in hhs
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Nov 8, 2024
1 parent 9e1c193 commit c48af1b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 23 deletions.
1 change: 1 addition & 0 deletions assets/hhs-icons.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions bin/apps/bash/app-commons.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down
50 changes: 29 additions & 21 deletions bin/apps/bash/hhs-app/functions/web.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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}\" !"
}
1 change: 1 addition & 0 deletions dotfiles/bash/bash_icons.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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" #
Expand Down

0 comments on commit c48af1b

Please sign in to comment.