From 83c44f6c6039afaa9c49f0e3c3a49ba8d9a03144 Mon Sep 17 00:00:00 2001 From: Arthur de Moulins Date: Fri, 13 Mar 2020 14:08:35 +0100 Subject: [PATCH] change dc alias into a function so it could be dynamic --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a277761d1d..f394ace118 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,17 @@ export PHRASEANET_APP_PORT=8082 It may be easier to deal with a local file to manage our env variables. -You can add your `env.local` at the root of this project and define a command alias in your `~/.bashrc`: +You can add your `env.local` at the root of this project and define a command function in your `~/.bashrc`: ```bash -alias dc="env $(cat env.local | grep -v '#' | tr '\n' ' ') docker-compose" +# ~/.bashrc or ~/.zshrc +function dc() { + if [ -f env.local ]; then + env $(cat env.local | grep -v '#' | tr '\n' ' ') docker-compose $@ + else + docker-compose $@ + fi +} ``` ### Running the application