paulirish / git-open

Type `git open` to open the GitHub page or website for a repository in your browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bad substitution

arianf opened this issue · comments

I get the following when I type git open

/Users/arian/.oh-my-zsh/custom/plugins/git-open/git-open: line 99: ${ssh_optcode^^}: bad substitution

If an incorrect URL is opened, please provide the following so we can write a test:

Example clone url:

git@github.foo.example.com:abc/abc-dfg.git

Example branch name:

one-to-one-3

Expected web URL:

It went to the right url

https://github.foo.example.com/abc/abc-dfg/tree/one-to-one-3

What version of bash do you have? Can you run bash --version for me?

Most likely a side effect of #109 rather than ZSH since the zsh plugin looks to just add it to the path

bash --version                       
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
Copyright (C) 2007 Free Software Foundation, Inc.

zsh --version
zsh 5.3 (x86_64-apple-darwin17.0)

My installation process:

# install Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# install plugin
git clone https://github.com/paulirish/git-open.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/git-open

I experience the same issue

$ git open
/usr/local/bin/git-open: line 99: ${ssh_optcode^^}: bad substitution
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
Copyright (C) 2007 Free Software Foundation, Inc.

this worked for me, im using zsh 5.5.1

vi git-open

replace all ${ssh_optcode^^} with $(tr '[a-z]' '[A-Z]'<<< ${ssh_optcode})

@JudeQuintana fyi it should call your bash, not zsh (Even if you run it there). Thanks for taking a deeper look. Sounds like this is an issue with less than bash 4.0.

Looks like we should add in bash < 4.0 testing in CI. In the meantime thanks for your patience, I got a PR up if you would like to confirm

@derimagia ahh yeah i'm bash 3.2.57. thanks for the making the PR. git-open is an awesome tool.

If this is fixed, can we close this issue?