From d9a54a6c31770f13fd77aecd012e1158b6140616 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Jan 2025 18:45:34 -0600 Subject: still rm old code --- unix.go | 48 +++--------------------------------------------- 1 file changed, 3 insertions(+), 45 deletions(-) (limited to 'unix.go') diff --git a/unix.go b/unix.go index 69cc02d..69eda29 100644 --- a/unix.go +++ b/unix.go @@ -3,15 +3,13 @@ package repostatus import ( "os" "os/exec" - "path/filepath" "strings" - "time" - "github.com/go-cmd/cmd" "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) @@ -73,48 +71,6 @@ func Exists(file string) bool { } return true } - -/* -func getDurationStamp(t time.Time) string { - - // Get the current time - currentTime := time.Now() - - // Calculate the duration between t current time - duration := currentTime.Sub(t) - - return formatDuration(duration) -} - -func formatDuration(d time.Duration) string { - seconds := int(d.Seconds()) % 60 - minutes := int(d.Minutes()) % 60 - hours := int(d.Hours()) % 24 - days := int(d.Hours()) / 24 - years := int(d.Hours()) / (24 * 365) - - result := "" - if years > 0 { - result += fmt.Sprintf("%dy ", years) - return result - } - if days > 0 { - result += fmt.Sprintf("%dd ", days) - return result - } - if hours > 0 { - result += fmt.Sprintf("%dh ", hours) - return result - } - if minutes > 0 { - result += fmt.Sprintf("%dm ", minutes) - return result - } - if seconds > 0 { - result += fmt.Sprintf("%ds", seconds) - } - return result -} */ func (rs *RepoStatus) XtermNohup(cmdline string) { @@ -149,6 +105,7 @@ func (rs *RepoStatus) XtermBash(args []string) { } } +/* func (rs *RepoStatus) DoAll(all [][]string) bool { for _, cmd := range all { log.Log(WARN, "doAll() RUNNING: cmd =", cmd) @@ -161,3 +118,4 @@ func (rs *RepoStatus) DoAll(all [][]string) bool { } return true } +*/ -- cgit v1.2.3