mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-26 05:37:18 +02:00
WIP
This commit is contained in:
parent
d5a5633771
commit
be2bf77bf0
18
main/main.go
Normal file
18
main/main.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
cmd := exec.Command("lazygit")
|
||||||
|
cmd.Env = os.Environ()
|
||||||
|
fmt.Println(cmd.Env)
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stdin = os.Stdin
|
||||||
|
err := cmd.Run()
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
@ -315,18 +315,27 @@ func runLazygit(t *testing.T, testPath string, rootDir string, record bool, spee
|
|||||||
cmd.Stdin = os.Stdin
|
cmd.Stdin = os.Stdin
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
cmd.Env = append(
|
cmd.Env = append(
|
||||||
cmd.Env,
|
os.Environ(),
|
||||||
fmt.Sprintf("RECORD_EVENTS_TO=%s", replayPath),
|
fmt.Sprintf("RECORD_EVENTS_TO=%s", replayPath),
|
||||||
|
"TERM=xterm-256color",
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stdin = os.Stdin
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
cmd.Env = append(
|
cmd.Env = append(
|
||||||
cmd.Env,
|
os.Environ(),
|
||||||
fmt.Sprintf("REPLAY_EVENTS_FROM=%s", replayPath),
|
fmt.Sprintf("REPLAY_EVENTS_FROM=%s", replayPath),
|
||||||
|
"TERM=xterm-256color",
|
||||||
)
|
)
|
||||||
|
t.Log(cmd.Env)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t.Log("here")
|
||||||
|
|
||||||
// if we're on CI we'll need to use a PTY. We can work that out by seeing if the 'TERM' env is defined.
|
// if we're on CI we'll need to use a PTY. We can work that out by seeing if the 'TERM' env is defined.
|
||||||
if runInPTY() {
|
if runInPTY() {
|
||||||
|
t.Log("1")
|
||||||
cmd.Env = append(cmd.Env, "TERM=xterm")
|
cmd.Env = append(cmd.Env, "TERM=xterm")
|
||||||
|
|
||||||
f, err := pty.StartWithSize(cmd, &pty.Winsize{Rows: 100, Cols: 100})
|
f, err := pty.StartWithSize(cmd, &pty.Winsize{Rows: 100, Cols: 100})
|
||||||
@ -338,6 +347,7 @@ func runLazygit(t *testing.T, testPath string, rootDir string, record bool, spee
|
|||||||
|
|
||||||
_ = f.Close()
|
_ = f.Close()
|
||||||
} else {
|
} else {
|
||||||
|
t.Log("2")
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ func (gui *Gui) timeSinceStart() int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) replayRecordedEvents() {
|
func (gui *Gui) replayRecordedEvents() {
|
||||||
|
gui.Log.Warn("going to replay events")
|
||||||
if os.Getenv("REPLAY_EVENTS_FROM") == "" {
|
if os.Getenv("REPLAY_EVENTS_FROM") == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -75,6 +76,7 @@ func (gui *Gui) replayRecordedEvents() {
|
|||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
timeWaited += 1
|
timeWaited += 1
|
||||||
if gui.g != nil && timeWaited >= timeToWait {
|
if gui.g != nil && timeWaited >= timeToWait {
|
||||||
|
gui.Log.Warn("replaying event")
|
||||||
gui.g.ReplayedEvents <- *event.Event
|
gui.g.ReplayedEvents <- *event.Event
|
||||||
break middle
|
break middle
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ func (gui *Gui) getConfirmationView() *gocui.View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) getInformationView() *gocui.View {
|
func (gui *Gui) getInformationView() *gocui.View {
|
||||||
v, _ := gui.g.View("confirmation")
|
v, _ := gui.g.View("information")
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user