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