pull/2029/merge
James Aaron Erang 5 months ago committed by GitHub
commit 45bac9ec8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6,15 +6,16 @@ function install_fail() {
exit 1 exit 1
} }
# This is the help fuction. It helps users withe the options # This is the help fuction. It helps users with the options
# This is the help fuction. It helps users with the options
function Help() { function Help() {
echo "Usage: install.sh [option]" echo "Usage: install.sh [option]"
echo "Options:" echo "Options:"
echo " -h: Show this help message and exit" echo -e "\t-h: Show this help message and exit"
echo " -d: Install only dependencies" echo -e "\t-d: Install only dependencies"
echo " -p: Install only python dependencies (including playwright)" echo -e "\t-p: Install only python dependencies (including playwright)"
echo " -b: Install just the bot" echo -e "\t-b: Install just the bot"
echo " -l: Install the bot and the python dependencies" echo -e "\t-l: Install the bot and the python dependencies"
} }
# Options # Options
@ -74,26 +75,26 @@ function install_macos(){
# Function to install for arch (and other forks like manjaro) # Function to install for arch (and other forks like manjaro)
function install_arch() { function install_arch() {
echo "Installing required packages" echo "Installing required packages"
sudo pacman -S --needed python3 tk git && python3 -m ensurepip unzip || install_fail sudo pacman -S --needed python3 python-pipx tk git unzip
python -m ensurepip || install_fail
} }
# Function to install for debian (and ubuntu) # Function to install for debian (and ubuntu)
function install_deb() { function install_deb() {
echo "Installing required packages" echo "Installing required packages"
sudo apt install python3 python3-dev python3-tk python3-pip unzip || install_fail sudo apt install python3 pipx python3-dev python3-tk python3-pip unzip || install_fail
} }
# Function to install for fedora (and other forks) # Function to install for fedora (and other forks)
function install_fedora() { function install_fedora() {
echo "Installing required packages" echo "Installing required packages"
sudo dnf install python3 python3-tkinter python3-pip python3-devel unzip || install_fail sudo dnf install python3 pipx python3-tkinter python3-pip python3-devel unzip || install_fail
} }
# Function to install for centos (and other forks based on it) # Function to install for centos (and other forks based on it)
function install_centos() { function install_centos() {
echo "Installing required packages" echo "Installing required packages"
sudo yum install -y python3 || install_fail sudo yum install -y python3-tkinter pipx epel-release python3-pip unzip python3 || install_fail
sudo yum install -y python3-tkinter epel-release python3-pip unzip|| install_fail
} }
function get_the_bot() { function get_the_bot() {
@ -108,12 +109,13 @@ function get_the_bot(){
function install_python_dep() { function install_python_dep() {
# tell the user that the script is going to install the python dependencies # tell the user that the script is going to install the python dependencies
echo "Installing python dependencies" echo "Installing python dependencies"
# cd into the directory
cd RedditVideoMakerBot-master
# install the dependencies # install the dependencies
pip3 install -r requirements.txt DEP_LIST=./RedditVideoMakerBot-master/requirements.txt
# cd out if [[ -f $DEP_LIST ]]; then
cd .. while read -r DEPS; do
pipx install $DEPS
done < "$DEP_LIST"
fi
} }
# install playwright function # install playwright function
@ -123,8 +125,8 @@ function install_playwright(){
# cd into the directory where the script is downloaded # cd into the directory where the script is downloaded
cd RedditVideoMakerBot-master cd RedditVideoMakerBot-master
# run the install script # run the install script
python3 -m playwright install pipx run playwright install
python3 -m playwright install-deps pipx run playwright install-deps
# give a note # give a note
printf "Note, if these gave any errors, playwright may not be officially supported on your OS, check this issues page for support\nhttps://github.com/microsoft/playwright/issues" printf "Note, if these gave any errors, playwright may not be officially supported on your OS, check this issues page for support\nhttps://github.com/microsoft/playwright/issues"
if [ -x "$(command -v pacman)" ]; then if [ -x "$(command -v pacman)" ]; then

Loading…
Cancel
Save