summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-07 18:53:58 -0600
committerJeff Carr <[email protected]>2025-01-07 18:53:58 -0600
commit4dcd9a116440268b3400b7877c0dd291d3154346 (patch)
tree4cde4ebf74c7faedebc6e09c3b3dd709e62815b0
parentd9a54a6c31770f13fd77aecd012e1158b6140616 (diff)
mv code. eventually move to shell
-rw-r--r--unix.go86
1 files changed, 0 insertions, 86 deletions
diff --git a/unix.go b/unix.go
index 69eda29..8866854 100644
--- a/unix.go
+++ b/unix.go
@@ -1,78 +1,6 @@
package repostatus
-import (
- "os"
- "os/exec"
- "strings"
-
- "go.wit.com/lib/gui/shell"
- "go.wit.com/log"
-)
-
/*
-func (rs *RepoStatus) Run(cmd []string) cmd.Status {
- path := rs.realPath.String()
- r := shell.PathRun(path, cmd)
- output := strings.Join(r.Stdout, "\n")
- if r.Error != nil {
- log.Log(WARN, "cmd:", cmd)
- log.Log(WARN, "ouptput:", output)
- log.Log(WARN, "failed with error:", r.Error)
- }
- return r
-}
-
-// Set the path to the package
-func getfiles(pathToPackage string) {
- // List files in the directory
- err := filepath.Walk(pathToPackage, nil) // compiles but crashes
- if err == nil {
- log.Log(INFO, "directory ok", pathToPackage)
- } else {
- log.Warn("directory wrong", pathToPackage)
- }
-}
-
-func IsDirectory(path string) bool {
- info, err := os.Stat(path)
- if err != nil {
- return false
- }
- return info.IsDir()
-}
-
-func (rs *RepoStatus) Exists(filename string) bool {
- if rs == nil {
- log.Warn("rs == nil for Exists()")
- panic(-1)
- }
- testf := filepath.Join(rs.Path(), filename)
- if Exists(testf) {
- return true
- }
- return false
-}
-
-func (rs *RepoStatus) mtime(filename string) (time.Time, error) {
- pathf := filepath.Join(rs.Path(), filename)
- statf, err := os.Stat(pathf)
- if err == nil {
- return statf.ModTime(), nil
- }
- log.Log(REPOWARN, "mtime() error", pathf, err)
- return time.Now(), err
-}
-
-// returns true if the file exists
-func Exists(file string) bool {
- _, err := os.Stat(file)
- if err != nil {
- return false
- }
- return true
-}
-*/
-
func (rs *RepoStatus) XtermNohup(cmdline string) {
shell.XtermCmd(rs.Path(), []string{cmdline})
}
@@ -104,18 +32,4 @@ func (rs *RepoStatus) XtermBash(args []string) {
log.Log(WARN, "cmd = xterm", argsX)
}
}
-
-/*
-func (rs *RepoStatus) DoAll(all [][]string) bool {
- for _, cmd := range all {
- log.Log(WARN, "doAll() RUNNING: cmd =", cmd)
- r := rs.Run(cmd)
- if r.Error != nil {
- log.Log(WARN, "doAll() err =", r.Error)
- log.Log(WARN, "doAll() out =", r.Stdout)
- return false
- }
- }
- return true
-}
*/