Created
May 26, 2015 07:18
-
-
Save Jnesselr/3a588ef750130cbab064 to your computer and use it in GitHub Desktop.
Simple laravel environment manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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