Export WriteToStdin for use by clients

This commit is contained in:
2024-12-29 19:38:05 -05:00
parent fc2e77d8b8
commit d2034b458b
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ func DecryptGPG(targetLocation string) []string {
func EncryptGPG(input []string) []byte {
gpgCfg, _ := ParseConfig([][2]string{{"LIBMUTTON", "gpgID"}}, "")
cmd := exec.Command("gpg", "-q", "-r", gpgCfg[0], "-e")
writeToStdin(cmd, strings.Join(input, "\n"))
WriteToStdin(cmd, strings.Join(input, "\n"))
encryptedBytes, err := cmd.Output()
if err != nil {
fmt.Println(AnsiError + "Failed to encrypt data - Ensure that your GPG key is valid and that you have a valid GPG ID set in libmutton.ini" + AnsiReset)