From 36892162b51a51791653b7a0e29841bd38c5bd1b Mon Sep 17 00:00:00 2001 From: Thomas Larsen <55982377+badhorse79@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:13:07 +0200 Subject: [PATCH] fix: Git ignore .venv always (#15) --- devbox-plugins/base-config/plugin.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devbox-plugins/base-config/plugin.json b/devbox-plugins/base-config/plugin.json index 1df1d26..8f2e417 100644 --- a/devbox-plugins/base-config/plugin.json +++ b/devbox-plugins/base-config/plugin.json @@ -63,9 +63,10 @@ // 'activate' works for bash and zsh "if [ -f requirements.txt ];then . $VENV_DIR/bin/activate;fi", + // .venv seems to always be present when installing python, so ignore it even if venv is not activated // try to make adding to .gitignore idempotent // crudini tool tries to read from default section, as if was an ini file, and find the line starting with ".venv" and returns true if found - "if [ -f requirements.txt ]; then if crudini --get .gitignore \"\" \".venv\";then true; else echo -e '\n\n# Python virtual environment for tooling and Ansible\n.venv' >> .gitignore; fi; fi", + "if crudini --get .gitignore \"\" \".venv\";then true; else echo -e '\n\n# Python virtual environment for tooling and Ansible\n.venv' >> .gitignore; fi", // install repository requirements, which might point to other requirements files "if [ -f requirements.txt ];then pip install -r requirements.txt;fi",