Port to latest libmutton development version

This commit is contained in:
2025-06-01 15:31:33 -04:00
parent 499c9cdd40
commit 9ee2f7ae0f
4 changed files with 17 additions and 16 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ go 1.24.3
require ( require (
github.com/Trojan2021/BEAN v0.0.0-20241210230804-8f294833b514 github.com/Trojan2021/BEAN v0.0.0-20241210230804-8f294833b514
github.com/charmbracelet/glamour v0.7.0 github.com/charmbracelet/glamour v0.7.0
github.com/rwinkhart/go-boilerplate v0.0.0-20250601181619-e38a47784de0 github.com/rwinkhart/go-boilerplate v0.0.0-20250601184813-71b5056ca6b3
github.com/rwinkhart/libmutton v0.3.2-0.20250601181751-5f8789a0f018 github.com/rwinkhart/libmutton v0.3.2-0.20250601192431-d0f7b663d50f
golang.org/x/term v0.32.0 golang.org/x/term v0.32.0
) )
+4 -4
View File
@@ -57,12 +57,12 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rwinkhart/convertroman v0.2.0 h1:otUm939eXT77q/Lr31mJtMwVWEw0RjEUB71gO65h9OM= github.com/rwinkhart/convertroman v0.2.0 h1:otUm939eXT77q/Lr31mJtMwVWEw0RjEUB71gO65h9OM=
github.com/rwinkhart/convertroman v0.2.0/go.mod h1:Af6HqvX0EIM4Y3HcnNXbbRey1dLasGB7WU0+3Cowgmw= github.com/rwinkhart/convertroman v0.2.0/go.mod h1:Af6HqvX0EIM4Y3HcnNXbbRey1dLasGB7WU0+3Cowgmw=
github.com/rwinkhart/go-boilerplate v0.0.0-20250601181619-e38a47784de0 h1:Zuwn0er30tMYrBXD1n4nM3mkGhrLFAdn3sZyMHkxx2I= github.com/rwinkhart/go-boilerplate v0.0.0-20250601184813-71b5056ca6b3 h1:QgmV+Om1Z1Ix+nO6k9RRIzLpevkeeyrmCspIKysvsc4=
github.com/rwinkhart/go-boilerplate v0.0.0-20250601181619-e38a47784de0/go.mod h1:cnzIF45I0FCOvE4YIB+26pLCUx2kWyY2llKYZruNaRY= github.com/rwinkhart/go-boilerplate v0.0.0-20250601184813-71b5056ca6b3/go.mod h1:cnzIF45I0FCOvE4YIB+26pLCUx2kWyY2llKYZruNaRY=
github.com/rwinkhart/go-winio-easy-pipe-handles v0.0.0-20250407031321-96994a0e8410 h1:NhHwFM3Pgm6zRUfFKvi0p5ndjfFbVWsRwmmhyFlG4PE= github.com/rwinkhart/go-winio-easy-pipe-handles v0.0.0-20250407031321-96994a0e8410 h1:NhHwFM3Pgm6zRUfFKvi0p5ndjfFbVWsRwmmhyFlG4PE=
github.com/rwinkhart/go-winio-easy-pipe-handles v0.0.0-20250407031321-96994a0e8410/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/rwinkhart/go-winio-easy-pipe-handles v0.0.0-20250407031321-96994a0e8410/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/rwinkhart/libmutton v0.3.2-0.20250601181751-5f8789a0f018 h1:SpVerjfORaFmFep1s22YxqxDdJDd+VhGotsNbcOnX40= github.com/rwinkhart/libmutton v0.3.2-0.20250601192431-d0f7b663d50f h1:iNnwR3fXbg3/4hSc4Wh5Jg46dWJsgMJ+6tawvQvolg8=
github.com/rwinkhart/libmutton v0.3.2-0.20250601181751-5f8789a0f018/go.mod h1:KsTWIJIHZdtDsFNAxJ0Xjpfy0mEVks5EWatswZWgdn0= github.com/rwinkhart/libmutton v0.3.2-0.20250601192431-d0f7b663d50f/go.mod h1:npc39dSGbmN6s4XFIi1KKlKQ2PD61fz54WcvJHfMx3o=
github.com/rwinkhart/peercred-mini v0.1.0 h1:TiS6u8cEWzW55S9X4iVpU72Iuy/NG6rMUJMtUEVEFLw= github.com/rwinkhart/peercred-mini v0.1.0 h1:TiS6u8cEWzW55S9X4iVpU72Iuy/NG6rMUJMtUEVEFLw=
github.com/rwinkhart/peercred-mini v0.1.0/go.mod h1:+x4Mxc2veE+YePSOpcUasjimh7n799c1KraLuQwHR20= github.com/rwinkhart/peercred-mini v0.1.0/go.mod h1:+x4Mxc2veE+YePSOpcUasjimh7n799c1KraLuQwHR20=
github.com/rwinkhart/rcw v0.2.0 h1:/rFgJ+20OSThipKAX5KPwW2xbPpgh1zl49THmEkkPis= github.com/rwinkhart/rcw v0.2.0 h1:/rFgJ+20OSThipKAX5KPwW2xbPpgh1zl49THmEkkPis=
+5 -2
View File
@@ -114,8 +114,11 @@ func main() {
case "note", "-n": case "note", "-n":
field = 4 field = 4
case "rename", "-r": case "rename", "-r":
back.TargetIsFile(targetLocation, true, 0) // ensure location exists before prompting for new location isAccessible, _ := back.TargetIsFile(targetLocation, true) // error is ignored because dir/file status is irrelevant
cli.RenameCli(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory if !isAccessible {
other.PrintError("Failed to access location ("+targetLocation+")", back.ErrorTargetNotFound, true)
}
cli.RenameCli(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
default: default:
cli.HelpEdit() cli.HelpEdit()
} }
+6 -8
View File
@@ -78,16 +78,14 @@ fieldLoop:
// EntryReaderDecrypt is a wrapper for EntryReader that first decrypts an RCW-wrapped file before sending it to EntryReader. // EntryReaderDecrypt is a wrapper for EntryReader that first decrypts an RCW-wrapped file before sending it to EntryReader.
func EntryReaderDecrypt(targetLocation string, hideSecrets bool) { func EntryReaderDecrypt(targetLocation string, hideSecrets bool) {
isFile, _, err := back.TargetIsFile(targetLocation, true, 2) _, err := back.TargetIsFile(targetLocation, true)
if err != nil { if err != nil { // if the location does not exist or is a directory...
other.PrintError("Failed to verify target location: "+err.Error(), back.ErrorTargetNotFound, true) other.PrintError("Failed to verify target location: "+err.Error(), back.ErrorTargetNotFound, true)
} }
if isFile { decBytes, err := crypt.DecryptFileToSlice(targetLocation)
decBytes, err := crypt.DecryptFileToSlice(targetLocation) if err != nil {
if err != nil { other.PrintError("Failed to decrypt entry: "+err.Error(), global.ErrorDecryption, true)
other.PrintError("Failed to decrypt entry: "+err.Error(), global.ErrorDecryption, true)
}
EntryReader(decBytes, hideSecrets, false) // never sync if decrypting straight to EntryReader, as this means the entry could not have been modified
} }
EntryReader(decBytes, hideSecrets, false) // never sync if decrypting straight to EntryReader, as this means the entry could not have been modified
// do not exit, as this is the job of EntryReader // do not exit, as this is the job of EntryReader
} }