aboutsummaryrefslogtreecommitdiff
path: root/internal/crud
diff options
context:
space:
mode:
Diffstat (limited to 'internal/crud')
-rw-r--r--internal/crud/handler_edit.go3
-rw-r--r--internal/crud/handler_new.go11
2 files changed, 12 insertions, 2 deletions
diff --git a/internal/crud/handler_edit.go b/internal/crud/handler_edit.go
index f7bbe34..0e13be3 100644
--- a/internal/crud/handler_edit.go
+++ b/internal/crud/handler_edit.go
@@ -56,6 +56,9 @@ func EditNote(notePath, editorString string) error {
err = os.WriteFile(notePath, encrypted, noteInfo.Mode().Perm())
+ // utils.ClearTerm()
+ fmt.Println("Saved:", noteInfo.Name())
+
return err
}
diff --git a/internal/crud/handler_new.go b/internal/crud/handler_new.go
index df0aa6e..f949969 100644
--- a/internal/crud/handler_new.go
+++ b/internal/crud/handler_new.go
@@ -8,7 +8,7 @@ import (
"gitlab.com/whiteboardguy/eno/internal/utils"
)
-func NewNote(noteName, output string) error {
+func NewNote(output string) error {
fmt.Printf("Enter the passphrase: ")
password, err := utils.TakeSecureUserInput()
if err != nil {
@@ -29,7 +29,10 @@ func NewNote(noteName, output string) error {
return fmt.Errorf("passphrases do not match")
}
- encrypted, err := crypt.EncryptRawBytes([]byte(noteName), password)
+ encrypted, err := crypt.EncryptRawBytes(
+ []byte(string(utils.RandomLettersNumbers(37))+"\nYou can Delete all of this ^^^"),
+ password,
+ )
if err != nil {
return err
}
@@ -46,5 +49,9 @@ func NewNote(noteName, output string) error {
}
file.Sync()
+
+ // utils.ClearTerm()
+ fmt.Println("New note saved at:", file.Name())
+
return nil
}