gerep / git-open

Open your github project page from your terminal
53 stars 13 forks source link

Function `opengit` is Linux-specific #2

Closed jdickey closed 10 years ago

jdickey commented 10 years ago

Namely, it uses xdg-open, which is a common (Arch/Ubuntu/others) Linux command to open the Github URL. The equivalent command in OS X is open.

gerep commented 10 years ago

Hey @jdickey, I have accepted your pull request, as you may have noticed :) but it has a problem.

I'm under Linux and it's trying to open the browser using the Mac open command.

I have updated the code, locally, like this:

function _opengit_open()
{
  local open_cmd='huh?'
  if [ -z `echo $MACHTYPE | grep linux` ]; then
    open_cmd='open'
  else
    open_cmd='xdg-open'
  fi
  $open_cmd $1
}

For a reason, I don't understand, the line bellow is not working here

if [ -n `echo $MACHTYPE | grep darwin` ]; then

It's working, can you take a look at it please? I'm not a bash master :)

jdickey commented 10 years ago

gerep, sorry I got buried with work for a couple of weeks; investigating :smiley:

What is your $MACHTYPE value?

gerep commented 10 years ago

@jdickey No worries, we have time :)

My $MACHTYPE is x86_64-unknown-linux-gnu

gerep commented 10 years ago

Hey @jdickey how you doing? Working a lot I guess :smile:

Any updates o this issue?

jdickey commented 10 years ago

Sorry, @gerep; was out of action most of last week. Spent almost 3 days in hospital. I'll get on it Friday and Saturday this week; attempting to un-bury myself from work now. Sorry for being so slow.

gerep commented 10 years ago

Hey @jdickey I'm closing this issue because I've made some tests under Linux and Mac and it's working great.

If you think of another improvement please make a pull request.

Thanks a lot for your help.

jdickey commented 10 years ago

@gerep Thanks!