Mid refactor change some more stuff

This commit is contained in:
Andrei Miulescu 2018-08-12 21:04:47 +10:00
parent e65ddd7b6f
commit e8eb78617c
No known key found for this signature in database
GPG key ID: 7C452D659F3A0FCB
16 changed files with 220 additions and 118 deletions

21
main.go
View file

@ -1,29 +1,22 @@
package main
import (
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"os/user"
"path/filepath"
"github.com/davecgh/go-spew/spew"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/app"
"github.com/jesseduffield/lazygit/pkg/config"
git "gopkg.in/src-d/go-git.v4"
)
// ErrSubProcess is raised when we are running a subprocess
var (
ErrSubprocess = errors.New("running subprocess")
subprocess *exec.Cmd
commit string
version = "unversioned"
date string
@ -127,17 +120,5 @@ func main() {
// TODO remove this once r, w not used
setupWorktree()
app.Gui.Run()
for {
if err := run(); err != nil {
if err == gocui.ErrQuit {
break
} else if err == ErrSubprocess {
subprocess.Run()
} else {
log.Panicln(err)
}
}
}
app.Gui.RunWithSubprocesses()
}