Bump: github.com/rwinkhart/libmutton PRE-TAG => v0.2.1; add script for generating release binaries

This commit is contained in:
2024-08-13 21:46:14 -04:00
parent b68b2a8931
commit 9cc4965ed8
10 changed files with 35 additions and 19 deletions
+2 -1
View File
@@ -11,7 +11,8 @@ var (
)
const (
MUTNVersion = "0.2.B" // untagged releases feature a letter suffix corresponding to the eventual release version, e.g "0.2.A" -> "0.2.0", "0.2.B" -> "0.2.1"
AnsiBold = "\033[1m"
ansiBlackOnWhite = "\033[38;5;0;48;5;15m"
MUTNVersion = "0.2.B" // untagged releases feature a letter suffix corresponding to the eventual release version, e.g "0.2.A" -> "0.2.0", "0.2.B" -> "0.2.1"
)
+1 -1
View File
@@ -15,7 +15,7 @@ func AddEntry(targetLocation string, hideSecrets bool, entryType uint8) {
_, isAccessible := core.TargetIsFile(targetLocation, false, 0)
if isAccessible {
fmt.Println(core.AnsiError + "Target location already exists" + core.AnsiReset)
os.Exit(106)
os.Exit(core.ErrorTargetExists)
}
// ensure target containing directory exists and is a directory (not a file)
+4 -4
View File
@@ -22,7 +22,7 @@ func TempInitCli() {
gpgIDInt := inputMenuGen("Select GPG key:", uidSlice)
if gpgIDInt == 0 {
fmt.Println(core.AnsiError + "No GPG keys found - please generate one" + core.AnsiReset)
os.Exit(105)
os.Exit(core.ErrorTargetNotFound)
}
gpgID = uidSlice[gpgIDInt-1]
}
@@ -54,13 +54,13 @@ func TempInitCli() {
sshKeyProtected := inputBinary("Is the identity file password-protected?")
// initialize libmutton directories
core.DirInit(false)
oldDeviceID := core.DirInit(false)
// write config file (temporarily assigns sshEntryRoot and sshIsWindows to null to pass initial device ID registration)
core.WriteConfig([][3]string{{"MUTN", "textEditor", textEditor}, {"LIBMUTTON", "gpgID", gpgID}, {"LIBMUTTON", "sshUser", sshUser}, {"LIBMUTTON", "sshIP", sshIP}, {"LIBMUTTON", "sshPort", sshPort}, {"LIBMUTTON", "sshKey", sshKey}, {"LIBMUTTON", "sshKeyProtected", strconv.FormatBool(sshKeyProtected)}, {"LIBMUTTON", "sshEntryRoot", "null"}, {"LIBMUTTON", "sshIsWindows", "null"}}, false)
core.WriteConfig([][3]string{{"MUTN", "textEditor", textEditor}, {"LIBMUTTON", "gpgID", gpgID}, {"LIBMUTTON", "sshUser", sshUser}, {"LIBMUTTON", "sshIP", sshIP}, {"LIBMUTTON", "sshPort", sshPort}, {"LIBMUTTON", "sshKey", sshKey}, {"LIBMUTTON", "sshKeyProtected", strconv.FormatBool(sshKeyProtected)}, {"LIBMUTTON", "sshEntryRoot", "null"}, {"LIBMUTTON", "sshIsWindows", "false"}}, false)
// generate and register device ID
sshEntryRoot, sshIsWindows := sync.DeviceIDGen()
sshEntryRoot, sshIsWindows := sync.DeviceIDGen(oldDeviceID)
// update config file with sshEntryRoot and sshIsWindows
core.WriteConfig([][3]string{{"LIBMUTTON", "sshEntryRoot", sshEntryRoot}, {"LIBMUTTON", "sshIsWindows", sshIsWindows}}, true)
+1 -1
View File
@@ -74,7 +74,7 @@ func writeEntryCLI(targetLocation string, unencryptedEntry []string, hideSecrets
EntryReader(unencryptedEntry, hideSecrets, true)
} else {
fmt.Println(core.AnsiError + "No data supplied for entry" + core.AnsiReset)
os.Exit(105)
os.Exit(core.ErrorTargetNotFound)
}
}