mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-02 23:27:22 -04:00
Implement note editing
This commit is contained in:
@@ -21,13 +21,3 @@ func AddFolder(targetLocation string) {
|
||||
// TODO If in online mode, create the directory on the server
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// WriteEntry writes entryData to an encrypted file at targetLocation
|
||||
func WriteEntry(targetLocation string, entryData []string) {
|
||||
encryptedBytes := EncryptGPG(entryData)
|
||||
err := os.WriteFile(targetLocation, encryptedBytes, 0600)
|
||||
if err != nil {
|
||||
fmt.Println(AnsiError + "Failed to write to file: " + err.Error() + AnsiReset)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,16 @@ func TargetIsFile(targetLocation string, errorOnFail bool, failCondition uint8)
|
||||
}
|
||||
}
|
||||
|
||||
// WriteEntry writes entryData to an encrypted file at targetLocation
|
||||
func WriteEntry(targetLocation string, entryData []string) {
|
||||
encryptedBytes := EncryptGPG(entryData)
|
||||
err := os.WriteFile(targetLocation, encryptedBytes, 0600)
|
||||
if err != nil {
|
||||
fmt.Println(AnsiError + "Failed to write to file: " + err.Error() + AnsiReset)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// writeToStdin writes a string to a command's stdin
|
||||
func writeToStdin(cmd *exec.Cmd, input string) {
|
||||
stdin, _ := cmd.StdinPipe()
|
||||
|
||||
Reference in New Issue
Block a user