caktus / margarita

A collection of delicious Salt states for Django project deployments.
BSD 3-Clause "New" or "Revised" License
34 stars 8 forks source link

Spaces in env var values cause problems #120

Closed vkurup closed 8 years ago

vkurup commented 8 years ago

dotenv.sh uses this code to set up the environment:

export $(cat .env | grep -v ^# | xargs)

It seems that xargs reads items, delimited by spaces. One of my environment variables in RescueSMS had a space, so it broke. Fortunately it broke loudly, but it is also possible to break silently, as in this example:

~$ export $(echo 'NEW_RELIC_APP_NAME="myproject staging"' | xargs)
~$ echo $NEW_RELIC_APP_NAME
myproject