mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-08-14 17:08:48 +02:00
Use standard open command in current plugins
Substitutes the current duplicate logic for the standard and cross-platform function open_command in plugins: frontend-search, jira, node, web-search
This commit is contained in:
@ -14,16 +14,6 @@ function web_search() {
|
||||
github "https://github.com/search?q="
|
||||
)
|
||||
|
||||
# define the open command
|
||||
case "$OSTYPE" in
|
||||
darwin*) open_cmd="open" ;;
|
||||
cygwin*) open_cmd="cygstart" ;;
|
||||
linux*) open_cmd="xdg-open" ;;
|
||||
*) echo "Platform $OSTYPE not supported"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# check whether the search engine is supported
|
||||
if [[ -z "$urls[$1]" ]]; then
|
||||
echo "Search engine $1 not supported."
|
||||
@ -41,7 +31,7 @@ function web_search() {
|
||||
url="${(j://:)${(s:/:)urls[$1]}[1,2]}"
|
||||
fi
|
||||
|
||||
nohup $open_cmd "$url" &>/dev/null
|
||||
open_command "$url"
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user