From 6296979bf31197ae961cba7e96fc4d8a1f41e6fe Mon Sep 17 00:00:00 2001 From: Torsten Raudssus Date: Fri, 13 Dec 2024 22:29:21 +0100 Subject: [PATCH] Adding up correct alias that also handles missing .env file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfc32eb..acbda65 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Best used as alias, like in `.bashrc` with: ```bash -alias crewai="docker run --rm -it --env-file .env -v \$(pwd):/app src.ci/srv/crewai:latest" +alias crewai='f(){ if [ -f .env ]; then docker run --rm -it --env-file .env -v $(pwd):/app src.ci/srv/crewai:latest "$@"; else docker run --rm -it -v $(pwd):/app src.ci/srv/crewai:latest "$@"; fi }; f' ``` With this alias you can then directly work with the image, just by using the command `crewai`, assuming you have the User ID 1000, else you might need to make a custom image, see ARGS.