Add environment variables and encryptor package
This commit is contained in:
@@ -2,13 +2,14 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"password/account"
|
||||
"password/encrypter"
|
||||
"password/files"
|
||||
"password/output"
|
||||
"strings"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
var menu = map[string]func(*account.VaultWithDb){
|
||||
@@ -37,9 +38,12 @@ func menuCounter() func() {
|
||||
|
||||
func main() {
|
||||
color.Blue("__Менеджер паролей__")
|
||||
res := os.Getenv("PWD")
|
||||
fmt.Println(res)
|
||||
vault := account.NewVault(files.NewJsonDb("data.json"))
|
||||
// Load env file
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
output.PrintError("Не удалось найти файл .env")
|
||||
}
|
||||
vault := account.NewVault(files.NewJsonDb("data.json"), *encrypter.NewEncrypter())
|
||||
counter := menuCounter()
|
||||
Menu:
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user