From 874a2e36eef494d6967e6366fdbcd6b844aae3f6 Mon Sep 17 00:00:00 2001 From: Janik von Rotz Date: Sun, 27 Jul 2025 17:08:08 +0200 Subject: [PATCH] feat(pass): rename store-dotenv and restore-dotenv to save-dotenv and load-dotenv for clarity --- README.md | 14 ++++++++++---- bin/{restore-dotenv => load-dotenv} | 2 +- bin/{store-dotenv => save-dotenv} | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) rename bin/{restore-dotenv => load-dotenv} (88%) rename bin/{store-dotenv => save-dotenv} (87%) diff --git a/README.md b/README.md index 7c9ef5e..ae57322 100644 --- a/README.md +++ b/README.md @@ -803,14 +803,20 @@ For autocomplete add the command to the help table. ### Pass -#### store-dotenv +Set path to pass entry. ```bash - printf "$COLUMN" "store-dotenv" "" "Store content of .env in pass entry." +PASS_ENTRY=$(echo "env/${PWD##*/}" | tr '[:upper:]' '[:lower:]') ``` -#### restore-dotenv +#### save-dotenv ```bash - printf "$COLUMN" "restore-dotenv" "" "Restore content of .env from pass entry." + printf "$COLUMN" "save-dotenv" "" "Store content of .env in pass entry." +``` + +#### load-dotenv + +```bash + printf "$COLUMN" "load-dotenv" "" "Restore content to .env from pass entry." ``` diff --git a/bin/restore-dotenv b/bin/load-dotenv similarity index 88% rename from bin/restore-dotenv rename to bin/load-dotenv index daff3b6..6c4bf66 100644 --- a/bin/restore-dotenv +++ b/bin/load-dotenv @@ -1,6 +1,6 @@ #!/bin/bash -function restore-dotenv() { +function load-dotenv() { if pass find "$PASS_ENTRY" >/dev/null; then echo "Restore .env file from pass: $PASS_ENTRY" pass show "$PASS_ENTRY" > .env diff --git a/bin/store-dotenv b/bin/save-dotenv similarity index 87% rename from bin/store-dotenv rename to bin/save-dotenv index 5530de0..d12b7dc 100644 --- a/bin/store-dotenv +++ b/bin/save-dotenv @@ -1,10 +1,10 @@ #!/bin/bash -function store-dotenv() { +function save-dotenv() { if [ -f .env ]; then echo "Store .env file in pass: $PASS_ENTRY" cat .env | pass insert -m -f "$PASS_ENTRY" else echo "No .env file found." fi -} \ No newline at end of file +}