diff options
| author | Jeff Carr <[email protected]> | 2025-01-07 18:29:31 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-07 18:29:31 -0600 |
| commit | 9221f83aaf06eb53b63f77a1e13887aad143e070 (patch) | |
| tree | 525d3dfa070b899ca5b9df3a693ff2015d4af9c5 /unix.go | |
| parent | e323d5920c76e88948da9f9cfca9ef07e7ef9dd3 (diff) | |
rm old code
Diffstat (limited to 'unix.go')
| -rw-r--r-- | unix.go | 62 |
1 files changed, 2 insertions, 60 deletions
@@ -1,7 +1,6 @@ package repostatus import ( - "fmt" "os" "os/exec" "path/filepath" @@ -13,65 +12,6 @@ import ( "go.wit.com/log" ) -/* -// goes in one directory so it gets remote branch names -func listFiles(directory string) []string { - var files []string - fileInfo, err := os.ReadDir(directory) - if err != nil { - log.Error(err) - return nil - } - - for _, file := range fileInfo { - if file.IsDir() { - dirname := file.Name() - newdir, _ := os.ReadDir(directory + "/" + dirname) - for _, file := range newdir { - if !file.IsDir() { - files = append(files, dirname+"/"+file.Name()) - } - } - } else { - files = append(files, file.Name()) - } - } - - return files -} -*/ - -/* -func normalizeVersion(s string) string { - // reg, err := regexp.Compile("[^a-zA-Z0-9]+") - parts := strings.Split(s, "-") - if len(parts) == 0 { - return "" - } - reg, err := regexp.Compile("[^0-9.]+") - if err != nil { - log.Log(WARN, "normalizeVersion() regexp.Compile() ERROR =", err) - return parts[0] - } - clean := reg.ReplaceAllString(parts[0], "") - log.Log(INFO, "normalizeVersion() s =", clean) - return clean -} - -func splitVersion(version string) (a, b, c string) { - tmp := normalizeVersion(version) - parts := strings.Split(tmp, ".") - switch len(parts) { - case 1: - return parts[0], "", "" - case 2: - return parts[0], parts[1], "" - default: - return parts[0], parts[1], parts[2] - } -} -*/ - func (rs *RepoStatus) Run(cmd []string) cmd.Status { path := rs.realPath.String() r := shell.PathRun(path, cmd) @@ -134,6 +74,7 @@ func Exists(file string) bool { return true } +/* func getDurationStamp(t time.Time) string { // Get the current time @@ -174,6 +115,7 @@ func formatDuration(d time.Duration) string { } return result } +*/ func (rs *RepoStatus) XtermNohup(cmdline string) { shell.XtermCmd(rs.Path(), []string{cmdline}) |
