From 0e6ed176b3c6680ba9e6b6ffea8d45597326d414 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 2 May 2022 11:34:18 +0300 Subject: [PATCH] fix README --- HISTORY.md | 2 ++ README.md | 4 ++-- shard.yml | 2 +- src/pmng.cr | 32 +++++++++++++++----------------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 736ec2b..6f36841 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,8 @@ - ℹ️ - Information - ♻️ - Edited +## 0.2.4 - [02/05/2022] + ## 0.2.3 - [02/05/2022] - ♻️ - Password outdated date change to 3 month - ➕ - Added `pmng` logo diff --git a/README.md b/README.md index 147b3af..7273f5d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # 🔑 The very simple password manager for humans -![pmng](./docs/logo.png) +![pmng](./.docs/logo.png) # 📷 Screenshots -![Passwords](./docs/passwords.png) +![Passwords](./.docs/passwords.png) # 💾 Download diff --git a/shard.yml b/shard.yml index d33b282..760ab5a 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: pmng -version: 0.2.3 +version: 0.2.4 authors: - Alexander Popov diff --git a/src/pmng.cr b/src/pmng.cr index dfab7f9..3460a47 100644 --- a/src/pmng.cr +++ b/src/pmng.cr @@ -22,9 +22,9 @@ class Password property update : Int32 end -VERSION = "0.2.3" - -ASCII_LOGO = " +VERSION = "0.2.4b" +PASSWORD_FILE_PATH = "#{ENV["HOME"]}/.pwd.yml" +ASCII_LOGO = " ██████╗ ███╗ ███╗███╗ ██╗ ██████╗ ██╔══██╗████╗ ████║████╗ ██║██╔════╝ ██████╔╝██╔████╔██║██╔██╗ ██║██║ ███╗ @@ -70,8 +70,6 @@ rescue ex puts ex.message, "" end -PASSWORD_FILE_PATH = "#{ENV["HOME"]}/.pwd.yml" - # check password file exists if File.exists?(PASSWORD_FILE_PATH) yaml = File.open(PASSWORD_FILE_PATH) do |file| @@ -83,14 +81,6 @@ else exit(1) end -# fill passwords array -passwords_array = [] of Password -count = 0 -while count < yaml.size - passwords_array << Password.from_yaml(yaml[count].to_yaml) - count += 1 -end - # check file ppermissions password_file_permissions = File.info(PASSWORD_FILE_PATH).permissions.to_s @@ -100,6 +90,14 @@ if /\d{3}/.match(password_file_permissions).try &.[0] != "600" exit(1) end +# fill passwords array +passwords_array = [] of Password +count = 0 +while count < yaml.size + passwords_array << Password.from_yaml(yaml[count].to_yaml) + count += 1 +end + # pmng title system "clear" puts ASCII_LOGO.colorize(:yellow) @@ -121,10 +119,7 @@ while loop if password_string.to_s == ":q" # if ':q' to close program - system "clear" - puts "Bye! 👋" - - exit(0) + loop = false elsif password_string.to_s.size == 0 # if puts empty, retry prompt puts @@ -206,3 +201,6 @@ while loop puts "-----".colorize(:dark_gray).mode(:bold) puts end + +system "clear" +puts "Bye! 👋"