Dotfiles/bin/.bin/open-local
2019-07-30 14:06:10 +01:00

21 lines
428 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/zsh
# absolute path to image folder
FOLDER="$PWD"
PH="${${PWD%/public_html*}%/wiki*}"
FILE="https://${PH##*/}.local.jh"
# get current open browser command
case $( uname -s ) in
Darwin) open=open;;
MINGW*) open=start;;
CYGWIN*) open=cygstart;;
MSYS*) open="powershell.exe NoProfile Start";;
*) open=${BROWSER:-xdg-open};;
esac
# open it in a browser
$open "$FILE" &> /dev/null & disown
exit $?