Skip to content

Instantly share code, notes, and snippets.

@nicksantamaria
Created November 29, 2019 05:25
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 nicksantamaria/6aec6ad434882728066301868ea0fe87 to your computer and use it in GitHub Desktop.
Save nicksantamaria/6aec6ad434882728066301868ea0fe87 to your computer and use it in GitHub Desktop.
function dc() {
FILES=""
if [ -f docker-compose.yml ]; then
FILES+="-f docker-compose.yml "
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -f docker-compose.osx.yml ]; then
FILES+="-f docker-compose.osx.yml "
fi
if [ -f docker-compose.catalina.yml ]; then
FILES+="-f docker-compose.catalina.yml "
fi
elif [[ "$OSTYPE" == "linux"* ]]; then
if [ -f docker-compose.linux.yml ]; then
FILES+="-f docker-compose.linux.yml "
fi
fi
echo "docker-compose $FILES $@"
docker-compose $FILES $@
}
# Helper commands.
# NOTE: We will use these later in the document.
alias dcu="dc up"
alias dcr="dc run"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment