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

Move the utils.go file into the /utils directory

This commit is contained in:
Chris Cummer
2019-08-05 10:50:12 -07:00
parent 0bd2d176d8
commit 4e46fff145
57 changed files with 190 additions and 188 deletions

View File

@@ -7,7 +7,7 @@ import (
"path"
"strings"
"github.com/wtfutil/wtf/wtf"
"github.com/wtfutil/wtf/utils"
)
type MercurialRepo struct {
@@ -37,7 +37,7 @@ func (repo *MercurialRepo) branch() string {
arg := []string{"branch", repo.repoPath()}
cmd := exec.Command("hg", arg...)
str := wtf.ExecuteCommand(cmd)
str := utils.ExecuteCommand(cmd)
return str
}
@@ -54,7 +54,7 @@ func (repo *MercurialRepo) changedFiles() []string {
arg := []string{"status", repo.repoPath()}
cmd := exec.Command("hg", arg...)
str := wtf.ExecuteCommand(cmd)
str := utils.ExecuteCommand(cmd)
data := strings.Split(str, "\n")
@@ -68,7 +68,7 @@ func (repo *MercurialRepo) commits(commitCount int, commitFormat string) []strin
arg := []string{"log", repo.repoPath(), numStr, commitStr}
cmd := exec.Command("hg", arg...)
str := wtf.ExecuteCommand(cmd)
str := utils.ExecuteCommand(cmd)
data := strings.Split(str, "\n")
@@ -78,14 +78,14 @@ func (repo *MercurialRepo) commits(commitCount int, commitFormat string) []strin
func (repo *MercurialRepo) pull() string {
arg := []string{"pull", repo.repoPath()}
cmd := exec.Command("hg", arg...)
str := wtf.ExecuteCommand(cmd)
str := utils.ExecuteCommand(cmd)
return str
}
func (repo *MercurialRepo) checkout(branch string) string {
arg := []string{"checkout", repo.repoPath(), branch}
cmd := exec.Command("hg", arg...)
str := wtf.ExecuteCommand(cmd)
str := utils.ExecuteCommand(cmd)
return str
}

View File

@@ -3,8 +3,8 @@ package mercurial
import (
"github.com/gdamore/tcell"
"github.com/rivo/tview"
"github.com/wtfutil/wtf/utils"
"github.com/wtfutil/wtf/view"
"github.com/wtfutil/wtf/wtf"
)
const offscreen = -1000
@@ -73,7 +73,7 @@ func (widget *Widget) Pull() {
}
func (widget *Widget) Refresh() {
repoPaths := wtf.ToStrs(widget.settings.repositories)
repoPaths := utils.ToStrs(widget.settings.repositories)
widget.Data = widget.mercurialRepos(repoPaths)