From 6dd5c83c386c9d7f35c9be0a590d2d2d48b15775 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Thu, 1 Feb 2024 15:07:55 -0700 Subject: [PATCH] add a launcher to symlink to $HOME/bin or whatever u have --- launcher.sh | 11 +++++++++++ lib/personality.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 launcher.sh diff --git a/launcher.sh b/launcher.sh new file mode 100755 index 0000000..4f793d2 --- /dev/null +++ b/launcher.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +SOURCE=${BASH_SOURCE[0]} +while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "$SOURCE") + [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) + +$DIR/venv/bin/python $DIR/run.py diff --git a/lib/personality.py b/lib/personality.py index 25ea996..6cf91aa 100644 --- a/lib/personality.py +++ b/lib/personality.py @@ -8,7 +8,7 @@ import psutil def load_personality(name: str, personality: str, system: str, pronoun: str, special_instructions: str = None): - if pronoun.lower() not in ['she', 'he']: + if pronoun.lower() not in ['he', 'she']: raise Exception('There are only two genders, xir...') if special_instructions: