Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Aug 20, 2016
1 parent b34a117 commit b03b61d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
31 changes: 4 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,37 +95,25 @@ $ open-pr develop
## Install using [antibody](http://getantibody.github.io/)

```console
$ antibody bundle caarlos0/zsh-open-pr
```

## Install using antigen

```console
$ antigen bundle caarlos0/zsh-open-pr
```

## Installing using zgen

```console
$ zgen load caarlos0/zsh-open-pr
$ antibody bundle caarlos0/zsh-open-pr kind:path
```

## Usage

Just hit `open_pr` on your repositories.
Just hit `git open-pr` on your repositories.

You can also alias it:

```console
$ git config --global alias.pr '!zsh -ic \"open_pr $*\"'
$ git config --global alias.pr open-pr
$ git pr
```

But I like the following approach more:

```console
gpr() {
git push origin HEAD && open_pr "$*"
git push origin HEAD && git open-pr "$@"
}
```

Expand All @@ -135,17 +123,6 @@ So I can `git push` and `open_pr` in a single, three letters command:
$ gpr
```

### PATH

You can, instead of sourcing, add the plugin to your path, so git will
automatically detect it. In the latest versions of antibody you can do that:

```console
antibody bundle 'caarlos0/zsh-open-pr kind:path'
```

And then just call `git open-pr`.

## Contributing

The project is linted with Shellcheck and have unit tests. Please, take a look
Expand Down
5 changes: 2 additions & 3 deletions git-open-pr
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _build_url() {
}

# shellcheck disable=SC2039
open_pr() {
__open_pr() {
# shellcheck disable=SC2039
local url
url="$(_build_url "$*")"
Expand All @@ -36,5 +36,4 @@ open_pr() {
fi
}

test "$0" != "$BASH_SOURCE" || echo "$ZSH_EVAL_CONTEXT" | egrep ":file$" ||
open_pr "$@"
__open_pr "$@"
1 change: 0 additions & 1 deletion open-pr.plugin.zsh

This file was deleted.

0 comments on commit b03b61d

Please sign in to comment.