commit cec08b9e5e29a2b5b1103d89390f456349cac234
parent 4c632276bb7da90ad6cd075a077c1a5ef7f8e0e9
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 24 Apr 2019 12:49:42 +0200
Fix browser-open switch
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/bin/shdl b/bin/shdl
@@ -35,6 +35,7 @@ function strip_doi {
}
function browser_open {
+ echo "$1"
if command -v tor-browser 2>/dev/null; then
[ "$verbose" = 1 ] && echo "attempting to launch tor-browser"
tor-browser "$1"
@@ -50,7 +51,6 @@ function browser_open {
}
function shdl_fetch {
- doi=$(echo "$1" | strip_doi)
shurl="$shhost/$doi"
[ "$verbose" = 1 ] && echo "processing $doi"
[ "$verbose" = 1 ] && echo "connecting to $shurl $prefix"
@@ -74,7 +74,8 @@ function shdl_fetch {
function handle_doi {
if [ "$browser" = 1 ]; then
- browser_open "$1"
+ shurl="$shhost/$1"
+ browser_open "$shurl"
else
shdl_fetch "$1"
fi