add more xterm options
This commit is contained in:
parent
e7a3ef1298
commit
d7a0246af9
26
common.go
26
common.go
|
@ -82,3 +82,29 @@ func (rs *RepoStatus) RepoType() string {
|
|||
log.Info("package is: unknown", err)
|
||||
return ""
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) BinaryName() string {
|
||||
// get the package name from the repo name
|
||||
path := rs.String()
|
||||
parts := strings.Split(path, "/")
|
||||
name := parts[len(parts)-1]
|
||||
return name
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) Build() bool {
|
||||
name := rs.BinaryName()
|
||||
// removes the binary if it already exists
|
||||
rs.RunCmd([]string{"rm", "-f", name})
|
||||
if rs.Exists(name) {
|
||||
log.Warn("file could not be removed filename =", name)
|
||||
return false
|
||||
}
|
||||
log.Info("need to build here", rs.String())
|
||||
rs.RunCmd([]string{"go", "build", "-v", "-x"})
|
||||
if rs.Exists(name) {
|
||||
log.Warn("build worked", name)
|
||||
return true
|
||||
}
|
||||
log.Warn("build failed", name)
|
||||
return false
|
||||
}
|
||||
|
|
29
unix.go
29
unix.go
|
@ -382,3 +382,32 @@ func (rs *RepoStatus) Xterm(args []string) {
|
|||
log.Info("cmd = xterm", argsX)
|
||||
}
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) XtermHold(args []string) {
|
||||
var argsX = []string{"-hold", "-geometry", "120x40"}
|
||||
/*
|
||||
if xtermHold.Checked() {
|
||||
log.Println("hold = true")
|
||||
argsXterm = append(argsXterm, "-hold")
|
||||
} else {
|
||||
log.Println("hold = false")
|
||||
}
|
||||
*/
|
||||
argsX = append(argsX, "-e", "bash", "-c")
|
||||
argsX = append(argsX, args...)
|
||||
log.Info("xterm cmd=", argsX)
|
||||
// set less to not exit on small diff's
|
||||
os.Setenv("LESS", "-+F -+X -R")
|
||||
cmd := exec.Command("xterm", argsX...)
|
||||
path := rs.realPath.String()
|
||||
cmd.Dir = path
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Info("xterm.Run() failed")
|
||||
log.Info("path =", path)
|
||||
log.Info("cmd = xterm", argsX)
|
||||
} else {
|
||||
log.Info("xterm.Run() worked")
|
||||
log.Info("path =", path)
|
||||
log.Info("cmd = xterm", argsX)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue