diff options
author | Marc Cornellà <marc.cornella@live.com> | 2015-08-05 00:32:57 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2015-08-05 00:57:40 +0200 |
commit | d1d06b5675bebbe54f3d876eb993b6e89d8963c7 (patch) | |
tree | 198d6691cc238fbc61a527a2169b4acbd561d39f /plugins/web-search | |
parent | 2d0bfcf81846ea4cb0fe2a42f3dac7f2c60e77b7 (diff) | |
download | zsh-d1d06b5675bebbe54f3d876eb993b6e89d8963c7.tar.gz zsh-d1d06b5675bebbe54f3d876eb993b6e89d8963c7.tar.bz2 zsh-d1d06b5675bebbe54f3d876eb993b6e89d8963c7.zip |
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
Diffstat (limited to 'plugins/web-search')
-rw-r--r-- | plugins/web-search/web-search.plugin.zsh | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index d407edb96..7c3ad9046 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -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" } |