Skip to content

Instantly share code, notes, and snippets.

@Jnesselr
Created May 26, 2015 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jnesselr/3a588ef750130cbab064 to your computer and use it in GitHub Desktop.
Save Jnesselr/3a588ef750130cbab064 to your computer and use it in GitHub Desktop.
Simple laravel environment manager
#!/bin/sh
if [ $# -eq 0 ]
then
if [ ! -f ".env" ]
then
echo "No current environment found"
exit
fi
for f in `ls .env.*`
do
diff ".env" $f > /dev/null
if [ $? -eq 0 ]
then
echo ${f:5}
fi
done
exit
fi
if [ -f ".env.$1" ]
then
cp ".env.$1" ".env"
echo "Current environment is now $1"
else
echo "I couldn't find $1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment