diff options
Diffstat (limited to 'unix.go')
| -rw-r--r-- | unix.go | 48 |
1 files changed, 3 insertions, 45 deletions
@@ -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 } +*/ |
