summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-07 18:29:31 -0600
committerJeff Carr <[email protected]>2025-01-07 18:29:31 -0600
commit9221f83aaf06eb53b63f77a1e13887aad143e070 (patch)
tree525d3dfa070b899ca5b9df3a693ff2015d4af9c5 /unix.go
parente323d5920c76e88948da9f9cfca9ef07e7ef9dd3 (diff)
rm old code
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go62
1 files changed, 2 insertions, 60 deletions
diff --git a/unix.go b/unix.go
index ffe1610..69cc02d 100644
--- a/unix.go
+++ b/unix.go
@@ -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})