merge master

This commit is contained in:
Jesse Duffield 2018-08-08 08:58:24 +10:00
commit 5ca47c3f47
3 changed files with 28 additions and 11 deletions

View file

@ -25,16 +25,19 @@ script:
# - go get -v ./...
# - diff -u <(echo -n) <(gofmt -d .) # can't make gofmt ignore vendor directory
# - go vet $(go list ./... | grep -v /vendor/)
- if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -output="lazygit.." -ldflags "-X main.Rev=`git rev-parse --short HEAD` -X main.builddate=`date -u +%Y%m%d.%H%M%S`" -verbose ./...; fi
- if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -ldflags "-X main.Rev=`git rev-parse --short HEAD` -X main.builddate=`date -u +%Y%m%d.%H%M%S`" -verbose ./...; fi
- mv lazygit_windows_amd64.exe lazygit_windows_amd64_${TRAVIS_TAG}.exe
- mv lazygit_darwin_amd64 lazygit_darwin_amd64_${TRAVIS_TAG}
- mv lazygit_linux_amd64 lazygit_linux_amd64_${TRAVIS_TAG}
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: TnB8I+swjicHuGTXk3ncm1Aaa12eIJqWV/Lhcnbb01i39p6+fyn3vDMdWPcejt3R8gcJqv4wyP8UQVO9G1qkLppt6V/qAuY5x6nX0MgEa3t+8JLJnGYHZYsuIgan/ecAmeu5+6dgUhr9Oq6zQOEv/O88NsALzMlqnEQNXI8XSoScfhkiVDIp3zWov0vBizCdThnNgTx9zRpJVoqxmhWvgt+me2+fOhSx1Y+3ZA2gE7zq8IFAbxp36d0rsR5lKqmTuF+YsF9iQ7Ar+xCjbRunLsZx+VwGqGfpS/qS7EwsEqBI0vEO76eFJkwEsIzOvJiFNhBDUu3upquBFMT4uzxRxH3eV+J4mZtu29UDLdvKI5Q730Lk9AgmH4now+RmP08M0SEXJa+AnHeuBv2u1iU5bu+sI6CORVQzKQwOph9AABDjSZ54wrXIpYEeIW2sz8nx+hiG6QL1mqfM/l+55BR69u3vxKYMryQBxPuzhZCTOqqI4uahlb6GIUNZJ9vGZeIA9HFJq3ymW8cdrpYzhKf3Nx9jK+Yb81h5/AHq9iChXEC63VPCDXXGRllh2UYWNYCaAdtk+ekpLR8299e4CaEregy6g5U2S3/xrBKl87miu1uJ/fquXoxGdSU+JcmsmXZ26sGIU2TCYdNjSfIgpOyfMmB4JNtKHqWRHA9Fe42CRpA=
file:
- $GOPATH/bin/lazygit.windows.amd64.exe
- $GOPATH/bin/lazygit.darwin.amd64
- $GOPATH/bin/lazygit.linux.amd64
- lazygit_windows_amd64_${TRAVIS_TAG}.exe
- lazygit_darwin_amd64_${TRAVIS_TAG}
- lazygit_linux_amd64_${TRAVIS_TAG}
on:
repo: jesseduffield/lazygit
tags: true

18
gui.go
View file

@ -225,14 +225,28 @@ func layout(g *gocui.Gui) error {
v.FgColor = gocui.ColorWhite
}
if v, err := g.SetView("options", -1, optionsTop, width, optionsTop+2, 0); err != nil {
version := Rev
if version == "" {
version = "unversioned"
}
if v, err := g.SetView("options", -1, optionsTop, width-len(version)-2, optionsTop+2, 0); err != nil {
if err != gocui.ErrUnknownView {
return err
}
v.BgColor = gocui.ColorDefault
v.FgColor = gocui.ColorBlue
v.Frame = false
v.Title = "Options"
}
if v, err := g.SetView("version", width-len(version)-1, optionsTop, width, optionsTop+2, 0); err != nil {
if err != gocui.ErrUnknownView {
return err
}
v.BgColor = gocui.ColorDefault
v.FgColor = gocui.ColorGreen
v.Frame = false
renderString(g, "version", version)
// these are only called once
handleFileSelect(g, filesView)

10
main.go
View file

@ -12,12 +12,12 @@ import (
)
var (
startTime time.Time
debugging bool
Rev string
builddate string
startTime time.Time
debugging bool
Rev string
builddate string
debuggingPointer = flag.Bool("debug", false, "a boolean")
versionFlag = flag.Bool("v", false, "Print the current version")
versionFlag = flag.Bool("v", false, "Print the current version")
)
func homeDirectory() string {