diff --git a/.husky/post-commit b/.husky/post-commit index ab12c31..a094e92 100644 --- a/.husky/post-commit +++ b/.husky/post-commit @@ -1,3 +1,4 @@ echo "post-commit..." -git push gh -git push sh +. pack.sh +git push gh +git push sh diff --git a/install.sh b/install.sh index 6774b33..c76a1e6 100644 --- a/install.sh +++ b/install.sh @@ -1,26 +1,37 @@ #! /bin/sh -INSTALL_DIR=$HOME/.local/lib/simple-tts +DOWNLOAD_URL="https://git.ayo.run/ayo/simple-tts/raw/branch/main/simple-tts.tgz" +INSTALL_DIR=$HOME/.local/lib EXECUTABLE_BIN=$HOME/.local/bin + +TEMP_DIR=$(mktemp -d) +cleanup() { rm -rf $TEMP_DIR; } +trap cleanup EXIT + echo "Installing to: $INSTALL_DIR" -git clone https://git.ayo.run/ayo/simple-tts $INSTALL_DIR -python3 -m venv $INSTALL_DIR/.venv +echo "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" + +python3 -m venv $INSTALL_DIR/simple-tts/.venv # activate environment -. $INSTALL_DIR/.venv/bin/activate +. $INSTALL_DIR/simple-tts/.venv/bin/activate -python -m pip install -r $INSTALL_DIR/requirements.txt +python -m pip install -r $INSTALL_DIR/simple-tts/requirements.txt # deactivate environment deactivate # make executable -chmod u+x $INSTALL_DIR/tts.py +chmod u+x $INSTALL_DIR/simple-tts/tts.py # ln to bin -ln $INSTALL_DIR/tts.py $EXECUTABLE_BIN/tts +ln $INSTALL_DIR/simple-tts/tts.py $EXECUTABLE_BIN/tts # final instructions echo "\n\nInstallation done! Now run: tts --help"