sorin-ionescu / prezto

The configuration framework for Zsh
MIT License
13.98k stars 4.49k forks source link

git-hub-browse stopped working #1966

Closed idcrook closed 2 years ago

idcrook commented 2 years ago

Description

Function git-hub-browse intends to check for BROWSER envariable to be set, but instead errors with a message if BROWSER envariable is set.

Found source of issue: code tests -z $BROWSER

should instead be ! -z $BROWSER or -n $BROWSER

Expected behavior

$ gRb
# opens repo url by passing to $BROWSER

Actual behavior

$ gRb
git-hub-browse: browser not set or set to a non-existent browser

Steps to Reproduce

See above.

Versions

In https://github.com/sorin-ionescu/prezto/commit/a3643f124e91d9ef55da5c0bcf2b3be257e84843 "git: Optimize scripts for git helper functions"

...

-  if (( $+commands[$BROWSER] )); then
+  if [[ -z "$BROWSER" ]]; then
     "$BROWSER" "$url"