Make installbeta main version

This commit is contained in:
alvinlollo
2026-01-21 16:43:29 -08:00
parent 6b59a46ea0
commit cbfa10d666
+84 -20
View File
@@ -1,5 +1,12 @@
#!/usr/bin/bash #!/usr/bin/bash
PreviousWD=$(pwd)
skip_watermark=false
if [ "$1" = "--skip-watermark" ]; then
skip_watermark=true
fi
if [ "$skip_watermark" = false ]; then
clear clear
echo ' echo '
____ _ _ _ _ _ ____ _ _ _ _ _
@@ -9,10 +16,12 @@ echo '
|____/ \__ | \__ _|_| \_/ |_|_| |_|_|\___/|_|_|\___/ |____/ \__ | \__ _|_| \_/ |_|_| |_|_|\___/|_|_|\___/
|___/ |___/
--------------- Single Download script --------------- --------------- Single Download script (Beta) ---------------
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE UNDER THE GPL-2.0 LICENCE, THERE IS NO WARRANTY BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE UNDER THE GPL-2.0 LICENCE,
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. See the LICENCE for more detail THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
See the LICENCE for more detail
' '
fi
# Function to display error message # Function to display error message
function error_handler() { function error_handler() {
@@ -27,13 +36,15 @@ trap error_handler ERR
sudo pacman -Syu git zsh curl wget whiptail --noconfirm --needed sudo pacman -Syu git zsh curl wget whiptail --noconfirm --needed
if command -v pacman >/dev/null; then if command -v pacman >/dev/null; then
echo "pacman detected. Installing prerequisites" echo "pacman detected. Installing prerequisites"
sudo pacman -Syu git zsh curl wget whiptail golang fakeroot debugedit make gcc --noconfirm --needed sudo pacman -Syu git zsh curl wget whiptail --noconfirm --needed
fi fi
if command -v apt >/dev/null; then if command -v apt >/dev/null; then
echo "apt detected. Installing prerequisites" echo "apt detected. Installing prerequisites"
sudo apt install git zsh curl wget whiptail -y sudo apt update
sudo apt full-upgrade -y
sudo apt install git zsh curl wget whiptail -y
fi fi
# Ensure whiptail is installed # Ensure whiptail is installed
@@ -41,13 +52,25 @@ if ! command -v whiptail >/dev/null; then
echo "whiptail is not installed. Installing it now..." echo "whiptail is not installed. Installing it now..."
if command -v pacman >/dev/null; then if command -v pacman >/dev/null; then
echo "pacman detected. Installing prerequisites" echo "pacman detected. Installing prerequisites"
sudo pacman -S whiptail --noconfirm || { echo "Failed to install whiptail. Exiting."; exit 1; } sudo pacman -S whiptail --noconfirm || { echo "Failed to install whiptail. Exiting."; exit 1; }
# Reload zsh if it exists
if command -v zsh -h >/dev/null; then
source ~/.zshrc
fi
# Reload Bash
source ~/.bashrc
fi fi
if command -v apt >/dev/null; then if command -v apt >/dev/null; then
echo "apt detected. Installing prerequisites" echo "apt detected. Installing prerequisites"
sudo apt install whiptail -y || { echo "Failed to install whiptail. Exiting."; exit 1; } sudo apt install whiptail -y || { echo "Failed to install whiptail. Exiting."; exit 1; }
# Reload zsh if it exists
if command -v zsh -h >/dev/null; then
source ~/.zshrc
fi
# Reload Bash
source ~/.bashrc
fi fi
fi fi
@@ -82,39 +105,72 @@ for selection in $CHOICE; do
case $clean_selection in case $clean_selection in
"1") "1")
echo "Running zsh setup script..." echo "Running zsh setup script..."
curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/zsh.sh | bash # Runs local script unless it does not exist or fails
if [[ -f "zsh.sh" ]]; then
echo "Found local script, running..."
bash zsh.sh --skip-watermark
else
bash "$(curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/zsh.sh)" --skip-watermark
fi
;; ;;
"2") "2")
echo "Running LazyVim setup script..." echo "Running LazyVim setup script..."
curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/LazyVim.sh | bash # Runs local script unless it does not exist or fails
if [[ -f "LazyVim.sh" ]];then
echo "Found local script, running..."
bash LazyVim.sh
else
curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/LazyVim.sh | bash
fi
;; ;;
"3") "3")
echo "Installing Docker..." echo "Installing Docker..."
if ! command -v docker >/dev/null; then if ! command -v docker >/dev/null; then
echo "docker is NOT installed. Running installation commands..." echo "docker is NOT installed. Installing..."
curl -fsSL https://get.docker.com | sh curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER sudo usermod -aG docker $USER
else else
sudo usermod -aG docker $USER
echo "Docker is already installed." echo "Docker is already installed."
echo "+ sleep 10" && sleep 10
fi fi
;; ;;
"4") "4")
echo "Installing Pacman Packages..." echo "Installing Pacman Packages..."
if ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm; then # Check if pacman binary is installed
if command -v pacman </dev/null; then
echo "Cannot proceed: pacman binary not found"
exit 1 # exit with an error
fi
# Install pacman packages
# Runs local script unless it does not exit or fails
if [[ -f "./configs/PackagesPacman.txt" ]]; then
echo "Found local config"
cat ./configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm
elif ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm; then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to install Pacman packages. You can try running it manually:" echo "Failed to install Pacman packages. You can try running it manually:"
echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm" echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "+ sleep 10" && sleep 10
fi fi
;; ;;
"5") "5")
echo "Installing Yay and Yay Packages..." echo "Installing Yay and Yay Packages..."
if ! sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl; then # Check for pacman before installing yay
if command -v pacman </dev/null; then
echo "Cannot proceed: Not a arch based system"
exit 1 # Exit with an error
fi
# Install yay prerequisites
if ! sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl golang fakeroot debugedit make gcc; then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to install prerequisite packages for Yay. You can try running it manually:" echo "Failed to install prerequisite packages for Yay. You can try running it manually:"
echo "sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl" echo "sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl golang fakeroot debugedit make gcc"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
exit 1 # exit with an error
fi fi
# Check if yay binary exists
if ! command -v yay >/dev/null; then if ! command -v yay >/dev/null; then
echo "yay is NOT installed. Running installation commands..." echo "yay is NOT installed. Running installation commands..."
if ! git clone https://aur.archlinux.org/yay.git /tmp/yay_install; then if ! git clone https://aur.archlinux.org/yay.git /tmp/yay_install; then
@@ -122,22 +178,30 @@ for selection in $CHOICE; do
echo "Failed to clone yay repository. You can try running it manually:" echo "Failed to clone yay repository. You can try running it manually:"
echo "git clone https://aur.archlinux.org/yay.git /tmp/yay_install" echo "git clone https://aur.archlinux.org/yay.git /tmp/yay_install"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
exit 1 # exit with an error
elif ! (cd /tmp/yay_install && makepkg -si --noconfirm); then elif ! (cd /tmp/yay_install && makepkg -si --noconfirm); then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to build and install yay. You can try running it manually:" echo "Failed to build and install yay. You can try running it manually:"
echo "cd /tmp/yay_install && makepkg -si --noconfirm" echo "cd /tmp/yay_install && makepkg -si --noconfirm"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
exit 1 # exit with an error
fi fi
cd $PreviousWD
rm -rf /tmp/yay_install rm -rf /tmp/yay_install
else else
echo "Yay is already installed." echo "Yay is already installed."
fi fi
# Assuming PackagesYay.txt for yay packages, as per common practice # Install yay packages
if ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean All --answerdiff All - --noconfirm; then # Runs local script unless it does no exist or fails
if [[ -f "./config/PackagesYay.txt" ]]; then
echo "Found local config"
cat ./config/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm
elif ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm; then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to install Yay packages. You can try running it manually:" echo "Failed to install Yay packages. You can try running it manually:"
echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean All --answerdiff All - --noconfirm" echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "+ sleep 10" && sleep 10
fi fi
;; ;;
*) *)