summaryrefslogtreecommitdiff
path: root/indexHtml.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-14 10:47:08 -0600
committerJeff Carr <[email protected]>2024-12-14 10:47:08 -0600
commitdead6fe01f7599fc3b6a6b1ee77a9e69e7b325d1 (patch)
treee28026f0e331b4c7e80e3fb83f92e191298953eb /indexHtml.go
parent0775662416320c07651061e6e59b0cae217a9e2b (diff)
new args. use forgepb for versions and dates
Diffstat (limited to 'indexHtml.go')
-rw-r--r--indexHtml.go36
1 files changed, 10 insertions, 26 deletions
diff --git a/indexHtml.go b/indexHtml.go
index 1a87995..f0c0fd3 100644
--- a/indexHtml.go
+++ b/indexHtml.go
@@ -3,9 +3,8 @@ package main
import (
"fmt"
"net/http"
- "strconv"
"strings"
- "time"
+
"go.wit.com/log"
)
@@ -105,31 +104,16 @@ func indexBodyRepo(w http.ResponseWriter, gourl string, giturl string, desc stri
// }
var vtime, version string
gourl = strings.TrimSpace(gourl)
- tmp, _ := versionMap[gourl]
- parts := strings.Split(tmp, " ")
- if len(parts) > 0 {
- vtime = parts[0]
- }
- if len(parts) > 1 {
- version = parts[1]
- }
- log.Warn("gourl ", gourl, "vtime =", vtime, "version =", version)
-
- if vtime != "" {
- // Convert the string to an integer
- gitTagTimestampInt, _ := strconv.ParseInt(vtime, 10, 64)
-
- // Parse the Unix timestamp into a time.Time object
- gitTagDate := time.Unix(gitTagTimestampInt, 0)
-
- // Get the current time
- currentTime := time.Now()
-
- // Calculate the duration between the git tag date and the current time
- duration := currentTime.Sub(gitTagDate)
-
- vtime = formatDuration(duration)
+ if tmp, ok := versionMap[gourl]; ok {
+ // log.Info("gopath", gopath, "tmp", tmp)
+ parts := strings.Fields(tmp)
+ if len(parts) == 2 {
+ // log.Info("GOT HERE gopath", gopath, "tmp", tmp)
+ version = parts[0]
+ vtime = parts[1]
+ }
}
+ log.Info("gopath", gourl, "dur", vtime, "version", version)
fmt.Fprintln(w, " <td>"+version+"</td>") // version
fmt.Fprintln(w, " <td>"+vtime+"</td>") // dev version