Sync with latest libmutton development version

This commit is contained in:
2026-01-08 18:22:54 -05:00
parent 441730e0e0
commit 9af456590c
5 changed files with 22 additions and 18 deletions
+3 -3
View File
@@ -4,8 +4,8 @@ go 1.25.5
require (
github.com/charmbracelet/glamour v0.7.0
github.com/rwinkhart/go-boilerplate v0.1.1-0.20251211171453-df1fb21b2366
github.com/rwinkhart/libmutton v0.4.3-0.20260102005208-28286788a045
github.com/rwinkhart/go-boilerplate v0.1.1
github.com/rwinkhart/libmutton v0.4.3-0.20260108232004-d54b59030e72
golang.org/x/term v0.38.0
)
@@ -34,7 +34,7 @@ require (
github.com/yuin/goldmark-emoji v1.0.6 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/sys v0.40.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
+4 -4
View File
@@ -42,14 +42,14 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rwinkhart/glamour-temp-MUTN v0.7.2 h1:/CBexwkGdL8HuZjO7M0zzjGHaHCr9/r4XTOtUJa+pPE=
github.com/rwinkhart/glamour-temp-MUTN v0.7.2/go.mod h1:DN/eJaNQ5h7dgxzfmWFo7By+b82CKEUdNaY6z4R4v3c=
github.com/rwinkhart/go-boilerplate v0.1.1-0.20251211171453-df1fb21b2366 h1:aKB7jcFstg11bRqDnjNzQIGM4+VA4JlE1HDNaPRpm8g=
github.com/rwinkhart/go-boilerplate v0.1.1-0.20251211171453-df1fb21b2366/go.mod h1:cnzIF45I0FCOvE4YIB+26pLCUx2kWyY2llKYZruNaRY=
github.com/rwinkhart/go-boilerplate v0.1.1 h1:C+yyscGWeqvNpR91iw0i91zqX0LcxnCr1VOyT7iM4JY=
github.com/rwinkhart/go-boilerplate v0.1.1/go.mod h1:/NVRKGslU20E5xU5YOgXzWxA6aa94BMtv5MtHRTb5Ek=
github.com/rwinkhart/go-highlite v0.1.1 h1:9TxbRhYVfD/3YaEgNk1BtEiZ0t8/5mxDUZqNMXHodT0=
github.com/rwinkhart/go-highlite v0.1.1/go.mod h1:mWLMtCWcyV0BG4NeyPyAUGMjPvI0ds6vXmUq89QwBFA=
github.com/rwinkhart/go-winio v0.1.0 h1:b72agLW+dETGmhR3VbcbwnStfgKfc5AfgJOXBJDkaHg=
github.com/rwinkhart/go-winio v0.1.0/go.mod h1:ZWa7ssZJT30CCDGJ7fk/2SBTq9BIQrrVjrcss0UW2s0=
github.com/rwinkhart/libmutton v0.4.3-0.20260102005208-28286788a045 h1:NIOFaievf9iYJgfZ8k4VaAZovQlqhtRWTuCpDWnlYtc=
github.com/rwinkhart/libmutton v0.4.3-0.20260102005208-28286788a045/go.mod h1:nOEBckA0iNZePuXzkxpTlzBevKQlZqkvwstZjMB3yBU=
github.com/rwinkhart/libmutton v0.4.3-0.20260108232004-d54b59030e72 h1:sFtwqO//25lLwsD77wtxyojRKSrK+ABVZSWIZg5mf1w=
github.com/rwinkhart/libmutton v0.4.3-0.20260108232004-d54b59030e72/go.mod h1:qInUv19lzX1adFNI6Ih/IEVy+pktSTh/yA7cRTdVPH8=
github.com/rwinkhart/peercred-mini v0.1.2 h1:4cGWDbv0whvLeVvbUdx84V/9p+2fS+DEXgrA1KxlRFo=
github.com/rwinkhart/peercred-mini v0.1.2/go.mod h1:LLHG7YshHEpbpJJP+Il9nx2dnGj5O3VGE32rWmflj0c=
github.com/rwinkhart/rcw v0.2.4 h1:FrRSsl+ui1WLmDwqjLSROtFPKqSeGLEfF2SPENt4qP0=
+9 -4
View File
@@ -192,14 +192,19 @@ func main() {
case "startrcwd":
crypt.RCWDArgument()
case "sync":
_, err := syncclient.RunJob(true)
_, err := syncclient.RunJob()
if err != nil {
other.PrintError("Failed to sync entries: "+err.Error(), global.ErrorSyncProcess)
}
case "init":
err := core.LibmuttonInit(front.Input,
err := core.LibmuttonInit(
front.Input,
confirmRCWPassword("new"),
front.InputBinary("Preserve existing config directory?"),
false,
"",
map[string]any{"mutnTextEditor": getTextEditorInput()},
confirmRCWPassword("new"), front.InputBinary("Preserve existing config directory?"), false)
)
if err != nil {
other.PrintError("Initialization failed: "+err.Error(), 0)
}
@@ -219,7 +224,7 @@ func main() {
if err != nil {
other.PrintError("Failed to get current device ID: "+err.Error(), back.ErrorRead)
}
_, _, _, err = syncclient.GenDeviceID(oldDeviceID, "")
_, _, err = syncclient.GenDeviceID(oldDeviceID, "")
if err != nil {
other.PrintError("Failed to change device ID: "+err.Error(), global.ErrorSyncProcess)
}
+1 -1
View File
@@ -31,7 +31,7 @@ func CopyMenu(vanityPath string, decSlice []string, oldPassword string) {
}
} else {
fmt.Print("\n\n")
_, err := syncclient.RunJob(false)
_, err := syncclient.RunJob()
if err != nil {
other.PrintError("Failed to sync on copy menu entry: "+err.Error(), global.ErrorSyncProcess)
}
+5 -6
View File
@@ -48,7 +48,7 @@ func determineIndentation(skippedDirList []bool, dirList []string, currentDirInd
}
// printFileEntry handles processing for printing file entries (determines color, wraps lines, and prints).
func printFileEntry(entry string, lastSlash int, charCounter *int, indent int, colorAlternator int8, agingTimestamp int64) int8 {
func printFileEntry(entry string, lastSlash int, charCounter *int, indent int, colorAlternator int8, agingTimestamp *int64) int8 {
// determine color to print fileEntryName (alternate each time function is run)
var colorCode string
if colorAlternator > 0 {
@@ -98,8 +98,7 @@ func EntryListGen() {
if err != nil {
other.PrintError("Failed to generate entry list: "+err.Error(), back.ErrorRead)
}
var vanityPathsToTimestamps map[string]int64
vanityPathsToTimestamps, err = synccommon.GetEntryAges()
entryMap, err := synccommon.GetAllEntryData()
if err != nil {
other.PrintError("Failed to retrieve entry aging data: "+err.Error(), back.ErrorRead)
}
@@ -141,10 +140,10 @@ func EntryListGen() {
// fileList iteration
containsFiles := false // indicates whether the current directory contains files (entries)
for _, file := range fileList {
for _, vanityPath := range fileList {
// print the current file if it belongs in the current directory - otherwise, break the loop and move on to the next directory
if lastSlash := strings.LastIndex(file, "/") + 1; file[:lastSlash-1] == directory {
if lastSlash := strings.LastIndex(vanityPath, "/") + 1; vanityPath[:lastSlash-1] == directory {
// print directory header if this is the first run of the loop
if !containsFiles {
@@ -154,7 +153,7 @@ func EntryListGen() {
fmt.Printf("\n\n"+strings.Repeat(" ", indent*2)+ansiDirectoryHeader+"%s/"+back.AnsiReset+"\n", vanityDirectory)
}
colorAlternator = printFileEntry(file, lastSlash, &charCounter, indent, colorAlternator, vanityPathsToTimestamps[file])
colorAlternator = printFileEntry(vanityPath, lastSlash, &charCounter, indent, colorAlternator, entryMap[vanityPath].AgeTimestamp)
}
}