Created
May 28, 2020 06:07
-
-
Save from-unknown/fe9fa2b44c27d03302c1a7925fe4624e to your computer and use it in GitHub Desktop.
Switch .env file for different environment build
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
#!/usr/bin/env bash | |
env=$1 | |
if ! [ $# -eq 1 ]; then | |
echo "Please specify ENV" | |
echo Usage: | |
echo "$(basename $0)" ENV | |
echo ex: | |
echo "$(basename $0)" develop | |
echo "" | |
exit 1 | |
fi | |
if ! [[ -f ".env.production.${env}" ]]; then | |
echo file: .env.production."${env}" does not exit | |
exit 1 | |
fi | |
cp .env.production."$env" .env.production.local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Switch .env.production.local file for different build environments. e.x. develop, staging, production...
Just copy .env.production.${env} to .env.production.local.