Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
🐛 don't generate a .env-e backup file when using sed
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieconnolly committed Jan 2, 2017
1 parent b53f96d commit 63b76ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libexec/handles-setup-dotenv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi

cp $INPUT_FILE .env

sed -i -e "s/^SECRET_KEY=$/SECRET_KEY=$(echo $(openssl rand -base64 48) | sed -e 's/[\/&]/\\&/g')/" .env
sed -e "s/^SECRET_KEY=$/SECRET_KEY=$(echo $(openssl rand -base64 48) | sed -e 's/[\/&]/\\&/g')/" -i "" .env
for var in $(env | sed -ne "s/\([^=]*\)=.*/\1/p" | uniq); do
sed -i -e "s/^$var=$/$var=$(eval echo "\$$var" | sed -e 's/[\/&]/\\&/g')/" .env
sed -e "s/^$var=$/$var=$(eval echo "\$$var" | sed -e 's/[\/&]/\\&/g')/" -i "" .env
done

0 comments on commit 63b76ae

Please sign in to comment.