install.fairie/home/dot_local/bin/executable_shortgpt

34 lines
1 KiB
Text
Raw Normal View History

2023-08-02 00:53:20 -07:00
#!/usr/bin/env bash
# @file ~/.local/bin/shortgpt
# @brief Setup and launch ShortGPT
# @description
# This script is a script that will automatically setup and launch [ShortGPT](https://github.com/RayVentura/ShortGPT).
# ShortGPT allows you to create short videos automatically by leveraging AI.
### Ensure repository is cloned to ~/.local/share/shortgpt
if [ ! -d "${XDG_DATA_HOME:-$HOME/.local/share}/shortgpt" ]; then
git clone https://github.com/rayventura/shortgpt.git "${XDG_DATA_HOME:-$HOME/.local/share}/shortgpt"
fi
### Set working directory
cd "${XDG_DATA_HOME:-$HOME/.local/share}/shortgpt"
### Ensure virtualenv is initialized
if [ ! -d "${XDG_DATA_HOME:-$HOME/.local/share}/shortgpt/.venv" ]; then
virtualenv .venv
fi
### Source the virtualenv
source .venv/bin/activate
### Install requirements
pip3 install -r requirements.txt
### Run ShortGPT
python3 runShortGPT.py &
### Wait 5 seconds and open expected web address
2023-08-02 09:30:28 -07:00
echo "Waiting for shortGPT website to be available before opening it in a web browser"
2023-08-02 00:53:20 -07:00
sleep 5
open http://127.0.0.1:31415