From aedc5afefa93a91496f7fee658f3438bec0170a4 Mon Sep 17 00:00:00 2001 From: Abby <141393719+abby-freakazoid@users.noreply.github.com> Date: Wed, 1 May 2024 22:28:10 -0500 Subject: [PATCH] Improved TagStudio.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "set -e" to abort on error "cd …" to prevent creating .venv if script is launched outside git dir "[ … ]" to skip creating venv when it already exists --- TagStudio.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TagStudio.sh b/TagStudio.sh index 762f752..3c51561 100755 --- a/TagStudio.sh +++ b/TagStudio.sh @@ -1,5 +1,7 @@ #! /usr/bin/env bash -python3 -m venv .venv +set -e +cd "$(dirname "$0")" +! [ -d .venv ] && python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt python tagstudio/tag_studio.py