aboutsummaryrefslogtreecommitdiff
path: root/internal/crud/handler_new.go
diff options
context:
space:
mode:
authorishaan <contact@ishaan.cc>2026-07-13 10:13:54 +0530
committerishaan <contact@ishaan.cc>2026-07-13 10:13:54 +0530
commit388971e7a86be97f6a7412cd1d526016bc4e14ce (patch)
treedda2a60ce6907770a0962f7233136cd2d1e1e232 /internal/crud/handler_new.go
parent6fa6f58e43a13747388973fe0ec7018a2f0683df (diff)
w
Diffstat (limited to 'internal/crud/handler_new.go')
-rw-r--r--internal/crud/handler_new.go11
1 files changed, 9 insertions, 2 deletions
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
}