mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
Mid refactor change some more stuff
This commit is contained in:
parent
e65ddd7b6f
commit
e8eb78617c
16 changed files with 220 additions and 118 deletions
21
main.go
21
main.go
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue