Skip to content

Commit

Permalink
Merge pull request #15 from jannis-baum/issue/14-linux-bin-depends-on…
Browse files Browse the repository at this point in the history
…-alias-openxdg-open

Linux bin depends on alias open=xdg-open
  • Loading branch information
jannis-baum authored Aug 4, 2023
2 parents b21a5fb + 40be8b7 commit fba6941
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion viv
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ if ! [ -f "$1" ]; then
fi
FILE=`realpath "$1"`

if [ -z "$VIV_OPEN" ]; then
which open 1>/dev/null 2>/dev/null && VIV_OPEN="open"
which xdg-open 1>/dev/null 2>/dev/null && VIV_OPEN="xdg-open"

if [ -z "$VIV_OPEN" ]; then
echo 'Please specify an "open" command in $VIV_OPEN'
exit 1
fi
fi

[ -z "$VIV_PORT" ] && VIV_PORT=31622
VIV_ADDR=http://localhost:$VIV_PORT
[ -z "$VIV_CMD" ] && VIV_CMD=vivify-server
Expand All @@ -28,4 +38,4 @@ if ! curl --fail-with-body -v $VIV_ADDR/health 1>/dev/null 2>/dev/null; then
done
fi

open $VIV_ADDR/viewer$FILE
$VIV_OPEN $VIV_ADDR/viewer$FILE

0 comments on commit fba6941

Please sign in to comment.