From 5ba3a5294c1fed7a531d3579ccab1e1ab6799ef5 Mon Sep 17 00:00:00 2001 From: ranomier Date: Tue, 3 Dec 2024 02:25:33 +0100 Subject: [PATCH] =?UTF-8?q?trouble=20=F0=9F=98=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.sh b/main.sh index d5b67ae..177111f 100755 --- a/main.sh +++ b/main.sh @@ -8,16 +8,17 @@ # -p is a path to write the jpg to # alternativly you can write the path into PICTURE_PATH set -E -o pipefail -#shopt -s failglob +set -x export LC_ALL='C.UTF8' -P_PATH="./label.jpg" -I_TEXT="$(cat ./text.pango)" +export SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" + +P_PATH="$SCRIPT_DIR/label.jpg" +I_TEXT="$(cat "$SCRIPT_DIR"/text.pango 2>/dev/null || echo 'example text')" P_PATH="${PICTURE_PATH:-$P_PATH}" I_TEXT="${IMAGE_TEXT:-$I_TEXT}" - while getopts "p:t:" opt do case "$opt" in