make dc to use rallets-hub/docker-compose-dev.yml if current folder does not contain one

This commit is contained in:
hophacker 2019-06-02 22:36:13 +08:00
parent 68ade09a56
commit 07390f657f
2 changed files with 9 additions and 1 deletions

View File

@ -216,7 +216,6 @@ alias brewu='brew update && brew upgrade && brew cleanup && brew doctor'
# emacs
alias emacs="env LC_CTYPE=zh_CN.UTF-8 emacs"
alias dc='docker-compose -f docker-compose-dev.yml'
alias ds='dc exec server'
alias drspec='dc exec sidekiq rspec'
alias psetup='dc exec sidekiq rake parallel:setup'

View File

@ -172,3 +172,12 @@ function rgm {
echo "Rip Search with $regex..."
rg -U $regex
}
function dc {
if [ -e ./docker-compose-dev.yml ]; then
docker_file_path=./docker-compose-dev.yml
else
docker_file_path=~/Projects/rallets-hub/docker-compose-dev.yml
fi
docker-compose -f $docker_file_path $@
}