fix(installer): put to correct installation dir

This commit is contained in:
ayo 2026-06-07 21:04:51 +02:00
parent 875f377ae3
commit 170774ae0f

View file

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
DOWNLOAD_URL="https://git.ayo.run/ayo/simple-tts/raw/branch/main/simple-tts.tgz" DOWNLOAD_URL="https://git.ayo.run/ayo/simple-tts/raw/branch/main/simple-tts.tgz"
INSTALL_DIR=$HOME/.local/lib INSTALL_DIR=$HOME/.local/lib/simple-tts
EXECUTABLE_BIN=$HOME/.local/bin EXECUTABLE_BIN=$HOME/.local/bin
@ -9,29 +9,32 @@ TEMP_DIR=$(mktemp -d)
cleanup() { rm -rf $TEMP_DIR; } cleanup() { rm -rf $TEMP_DIR; }
trap cleanup EXIT trap cleanup EXIT
echo "Removing old installation if they exist" echo "[INSTALLER]: Removing old installation if they exist"
rm -rf $INSTALL_DIR/simple-tts rm -rf $INSTALL_DIR
rm $EXECUTABLE_BIN/tts rm $EXECUTABLE_BIN/tts
echo "Downloading simple-tts.tgz" echo "[INSTALLER]: Downloading simple-tts.tgz"
curl --fail --show-error --location --progress-bar \ curl --fail --show-error --location --progress-bar \
-o $TEMP_DIR/simple-tts.tgz "$DOWNLOAD_URL" -o "$TEMP_DIR/simple-tts.tgz" "$DOWNLOAD_URL"
tar -xzf $TEMP_DIR/simple-tts.tgz -C "$INSTALL_DIR"
echo "[INSTALLER]: Installing to: $INSTALL_DIR"
mkdir -p $INSTALL_DIR
tar -xvzf "$TEMP_DIR/simple-tts.tgz" -C "$INSTALL_DIR"
# activate environment # activate environment
echo "Installing to: $INSTALL_DIR/simple-tts" echo "[INSTALLER]: Installing required modules"
python3 -m venv $INSTALL_DIR/simple-tts/.venv python3 -m venv $INSTALL_DIR/.venv
. $INSTALL_DIR/simple-tts/.venv/bin/activate . $INSTALL_DIR/.venv/bin/activate
python -m pip install -r $INSTALL_DIR/simple-tts/requirements.txt python -m pip install -r $INSTALL_DIR/requirements.txt
# deactivate environment # deactivate environment
deactivate deactivate
# make executable # make executable
chmod u+x $INSTALL_DIR/simple-tts/tts.py chmod u+x $INSTALL_DIR/tts.py
# ln to bin # ln to bin
ln $INSTALL_DIR/simple-tts/tts.py $EXECUTABLE_BIN/tts ln $INSTALL_DIR/tts.py $EXECUTABLE_BIN/tts
# final instructions # final instructions
echo "\n\nInstallation done! Now run: tts --help" echo "[INSTALLER]: \n\nInstallation done! Now run: tts --help"