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 +}