Write and append to config file using ini package

This commit is contained in:
2024-06-05 14:56:17 -04:00
parent 97a9c0a921
commit 4f9c57d6da
8 changed files with 77 additions and 42 deletions
+1 -2
View File
@@ -8,7 +8,6 @@ import (
)
// TODO GPG support is a temporary feature - it will be replaced with a different encryption scheme in the future
// These functions may continue to exist after that point, but consider them deprecated
// DecryptGPG decrypts a GPG-encrypted file and returns the contents as a slice of (trimmed) strings
func DecryptGPG(targetLocation string) []string {
@@ -24,7 +23,7 @@ func DecryptGPG(targetLocation string) []string {
// EncryptGPG encrypts a slice of strings using GPG and returns the encrypted data as a byte slice
func EncryptGPG(input []string) []byte {
cmd := exec.Command("gpg", "-q", "-r", ReadConfig([]string{"gpgID"}, "")[0], "-e")
cmd := exec.Command("gpg", "-q", "-r", ParseConfig([]string{"gpgID"}, "")[0], "-e")
writeToStdin(cmd, strings.Join(input, "\n"))
encryptedBytes, err := cmd.Output()
if err != nil {