mirror of
https://github.com/chenasraf/git-open.git
synced 2026-05-18 01:38:59 +00:00
24 lines
395 B
Bash
Executable File
24 lines
395 B
Bash
Executable File
#!/usr/bin/env zsh
|
|
|
|
open_url() {
|
|
silent=""
|
|
if [[ "$1" =~ "-s|--silent" ]]; then
|
|
silent=1
|
|
shift
|
|
fi
|
|
if [[ "$1" == "" && $# -gt 1 ]]; then
|
|
shift
|
|
fi
|
|
if [[ -z "$silent" ]]; then
|
|
echo "Opening $1"
|
|
fi
|
|
is_mac=$(uname | grep -i darwin)
|
|
is_linux=$(uname | grep -i linux)
|
|
if [[ ! -z $is_mac ]]; then
|
|
open $1
|
|
elif [[ ! -z $is_linux ]]; then
|
|
xdg-open $1
|
|
fi
|
|
}
|
|
|