summaryrefslogtreecommitdiff
path: root/scan.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-13 23:42:06 -0600
committerJeff Carr <[email protected]>2024-01-13 23:42:06 -0600
commit595f4c6eb37b98afc155662904df9806308f5914 (patch)
tree18ea718d1facbab1d24705bcaab90a2c683eb116 /scan.go
parent15bcdb006e14840bae125a98ff479038e37eb47a (diff)
more code reorg
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'scan.go')
-rw-r--r--scan.go58
1 files changed, 58 insertions, 0 deletions
diff --git a/scan.go b/scan.go
new file mode 100644
index 0000000..74f926b
--- /dev/null
+++ b/scan.go
@@ -0,0 +1,58 @@
+// This is a simple example
+package main
+
+import (
+ "go.wit.com/log"
+
+ "go.wit.com/gui/gadgets/repostatus"
+)
+
+func (r *repo) newScan() bool {
+ if r.status == nil {
+ log.Warn("repo.status = nil. not initialized for some reason")
+ return false
+ }
+ // r.scan()
+ if repostatus.VerifyLocalGoRepo(r.getPath()) {
+ log.Warn("repo actually exists", r.getPath())
+ } else {
+ log.Warn("repo does not exist", r.getPath())
+ return false
+ }
+ mn := r.status.GetMasterName()
+ mv := r.status.GetMasterVersion()
+ r.masterVersion.Set(mn + "\n" + mv)
+
+ dn := r.status.GetDevelName()
+ dv := r.status.GetDevelVersion()
+ r.develVersion.Set(dn + "\n" + dv)
+
+ un := r.status.GetUserName()
+ uv := r.status.GetUserVersion()
+ r.jcarrVersion.Set(un + "\n" + uv)
+
+ cbname := r.status.GetCurrentBranchName()
+ cbversion := r.status.GetCurrentBranchVersion()
+ ltversion := r.status.GetLastTagVersion()
+ r.lastLabel.Set(cbname + "\n" + cbversion)
+ r.vLabel.Set(cbname + "\n" + ltversion)
+
+ if r.status.CheckDirty() {
+ log.Warn("CheckDirty() true")
+ r.dirtyLabel.Set("dirty")
+ return false
+ }
+ log.Warn("CheckDirty() no")
+ r.dirtyLabel.Set("not dirty")
+
+ if r.status.CheckBranches() {
+ log.Warn("Branches are Perfect")
+ r.dirtyLabel.SetText("PEFECT")
+ return true
+ } else {
+ log.Warn("Branches are not Perfect")
+ r.dirtyLabel.SetText("merge")
+ }
+
+ return false
+}