1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Closes #43. Add CommandRunner module to the app.

CommandRunner allows you to define a terminal command and arguments, run
it on a schedule, and view the output.

Examples:

   ping -3 cisco.com
This commit is contained in:
Chris Cummer
2018-05-17 17:15:03 -07:00
parent c3f14025ba
commit a62b910893
17 changed files with 74 additions and 50 deletions

View File

@@ -1,8 +1,6 @@
package git
import (
"time"
"github.com/gdamore/tcell"
"github.com/olebedev/config"
"github.com/rivo/tview"
@@ -26,7 +24,7 @@ const helpText = `
type Widget struct {
wtf.TextWidget
app *tview.Application
app *tview.Application
Data []*GitRepo
Idx int
pages *tview.Pages
@@ -36,9 +34,9 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
widget := Widget{
TextWidget: wtf.NewTextWidget(" Git ", "git", true),
app: app,
Idx: 0,
pages: pages,
app: app,
Idx: 0,
pages: pages,
}
widget.View.SetInputCapture(widget.keyboardIntercept)
@@ -54,10 +52,10 @@ func (widget *Widget) Refresh() {
}
repoPaths := wtf.ToStrs(Config.UList("wtf.mods.git.repositories"))
widget.Data = widget.gitRepos(repoPaths)
widget.UpdateRefreshedAt()
widget.Data = widget.gitRepos(repoPaths)
widget.display()
widget.RefreshedAt = time.Now()
}
func (widget *Widget) Next() {