scripts

My personal collection of scripts
git clone git://src.gearsix.net/scripts
Log | Files | Refs | Atom | README | LICENSE

commit b29176589832c62599a3c7e1d77b16e2725df954
parent ed97eca012471f730ba5afddb57ed29847ddbe0e
Author: gearsix <gearsix@tuta.io>
Date:   Wed, 26 Apr 2023 12:33:44 +0100

openurl fix

Diffstat:
Msrc/posix/openurl.sh | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/posix/openurl.sh b/src/posix/openurl.sh @@ -3,6 +3,9 @@ # description: xdg-open all urls found in $@ # e.g.$ openurl saved-links.txt +open=xdg-open +if [ "$(uname)" = "Darwin" ]; then open=open; fi + if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "usage: ./openurl.sh FILEPATHS..." echo "" @@ -12,9 +15,7 @@ fi for f in "$@"; do while read -r url; do - cmd=$(open "$url" | grep -q 'https?://(^")+' | tr -d '\r') - if [ "$(uname)" != "Darwin" ]; then cmd="xdg-"+$cmd; fi - $cmd + $open "$url" | grep -q 'https?://(^")+' | tr -d '\r' done < "$f" done