Skip to content

Commit

Permalink
fix(quickget): make open_homepage() works and swallow stdout/stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed May 6, 2024
1 parent 697c77f commit 1f546bc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -3364,11 +3364,14 @@ function get_windows() {
}

function open_homepage() {
local URL=""
local XDG_OPEN=""
if [ -z "$(os_info "${1}")" ]; then
error_specify_os
else
URL="$(os_info "${1}" | cut -d'|' -f4)"
xdg-open $URL || sensible-browser $URL || x-www-browser $URL || gnome-open $URL
URL="$(os_info "${1}" | cut -d'|' -f 4)"
XDG_OPEN=$(xdg-open "${URL}" || sensible-browser "${URL}" || x-www-browser "${URL}" || gnome-open "${URL}")
unset XDG_OPEN
exit 0
fi
}
Expand Down Expand Up @@ -3492,7 +3495,7 @@ case "${1}" in
;;
'--open-homepage'|'-o')
shift
open_homepage
open_homepage "${1}"
;;
'--version'|'-v')
WHERE=$(dirname "${BASH_SOURCE[0]}")
Expand Down

0 comments on commit 1f546bc

Please sign in to comment.