Skip to content

Commit

Permalink
Update install instructions, add homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
akupila committed May 13, 2018
1 parent b204901 commit cfc701f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ changelog:
- '^test:'
git:
short_hash: true
brew:
github:
owner: akupila
name: homebrew-gitprompt
name: gitprompt
homepage: https://github.com/akupila/gitprompt
description: "git status in the prompt"
77 changes: 62 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,75 @@ gitprompt -format="#B(@b#R%h[#y >%s][#m ↓%b ↑%a][#r x%c][#g +%m][#y ϟ%u]#B)
- `)` in highlight blue
- _any text printed after gitprompt will have all formatting cleared_

## Download
## Installation

Installation consists of two parts: get the binary & configure your shell to
use it.

### Get binary

<details>
<summary>Homebrew</summary>
<br/>
<pre>
$ brew tap akupila/gitprompt
$ brew install gitprompt
</pre>
</details
<details>
<summary>Install binary directly</summary>
<br/>
<pre>
$ curl -sfL https://install.goreleaser.com/github.com/akupila/gitprompt.sh | bash -s -- -b /usr/local/bin
</pre>
<p>
Feel free to change the path from <code>/usr/local/bin</code>, just make sure
<code>gitprompt</code> is available on your <code>$PATH</code> (check with
<code>gitprompt -version</code>).
</p>
</details>

<details>
<summary>Build from source</summary>
<br/>
<pre>
$ go get github.com/akupila/gitprompt/...
</pre>
<p>
The code has no vendored dependencies so no need to worry about that.
</p>
</details>

### Configure your shell

#### zsh

Add this to your `~/.zshrc`:

### MacOS

Install [Homebrew]
```
PROMPT='$(gitprompt)'
```

`TODO(akupila): brew cask`
Now reload the config (`source ~/.zshrc`) and gitprompt should show up. Feel
free to add anything else here too, just execute `gitprompt` where you want the
status, for example:

## Configure your shell
```
local ret_status="%(?:%{$fg_bold[green]%}$:%{$fg_bold[red]%}$)"
local dir="%{$fg[cyan]%}%3d"
PROMPT='${ret_status} ${dir} $(gitprompt)'
```

### zsh
#### Bash

gitprompt needs to execute as a part the `PROMPT`, add this to your `~/.zshrc`:
Add this to your `~/.bashrc`:

```
PROMPT='$(gitprompt)'
PS1='$(gitprompt)'
```

Now reload the config (`source ~/.zshrc`) and gitprompt should show up. Of
course you're free to add anything else here too, just execute `gitprompt`
where you want the status.


### Uninstallation

[Homebrew]: https://brew.sh/
1. Remove `gitprompt` from your shell config
2. Delete the binary `rm $(which gitprompt)`

0 comments on commit cfc701f

Please sign in to comment.