Bug fixing

This commit is contained in:
VetheonGames 2024-01-08 14:43:29 -07:00
parent a3fa99891b
commit ada3cd2b08

View File

@ -4,18 +4,18 @@ mkdir -p ~/.allpac/cache ~/.allpac/logs ~/.allpac/bin
echo "We are about to write a new pkg.list" echo "We are about to write a new pkg.list"
echo "Do you want us to proceed?" echo "Do you want us to proceed?"
echo "(reply "n" if you already have a pkg.list)" echo "(reply 'n' if you already have a pkg.list)"
read -p "Proceed? [Y/n] " -n 1 -r read -p "Proceed? [Y/n] " -n 1 -r
echo echo
if [[ $REPLY =~ ^[Yy]$ ]]; then if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Writing new pkg.list..." echo "Writing new pkg.list..."
sleep 1 sleep 1
touch ~/.allpac/pkg.list touch ~/.allpac/pkg.list
echo "{}" > pkg.list echo "{}" > ~/.allpac/pkg.list
else else
echo "Skipping writing new pkg.list..." echo "Skipping writing new pkg.list..."
sleep 1 sleep 1
fi fi
go_version=$(go version 2>/dev/null) go_version=$(go version 2>/dev/null)
required_version="go1.21.5" required_version="go1.21.5"
@ -24,13 +24,13 @@ echo "Checking if Go is installed..."
if [[ "$go_version" != *"$required_version"* ]]; then if [[ "$go_version" != *"$required_version"* ]]; then
echo "Required Go version is not installed." echo "Required Go version is not installed."
read -p "Do you want to install Go? (this will also preform a general system update with pacman) [Y/n] " -n 1 -r read -p "Do you want to install Go? (this will also perform a general system update with pacman) [Y/n] " -n 1 -r
echo echo
if [[ $REPLY =~ ^[Yy]$ ]]; then if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Running 'sudo pacman -Syu go' instead of 'pacman -Sy'..." echo "Running 'sudo pacman -Syu go' instead of 'pacman -Sy'..."
echo "Because the Arch Developers won't make Pacman alert you of this, I guess AllPac has to..." echo "Because the Arch Developers won't make Pacman alert you of this, I guess AllPac has to..."
echo "Running 'pacman -Sy'/'pacman -S' syncs the package database, but doesn't update the actual packages" echo "Running 'pacman -Sy'/'pacman -S' syncs the package database, but doesn't update the actual packages"
echo "This can cause a lot of problems if something get's updated but something that depends on it doesn't." echo "This can cause a lot of problems if something gets updated but something that depends on it doesn't."
echo "It's called a 'Partial Upgrade' and it can break your system" echo "It's called a 'Partial Upgrade' and it can break your system"
echo "If you wanna install a package and you don't use AllPac, always just run 'pacman -Syu {package}'" echo "If you wanna install a package and you don't use AllPac, always just run 'pacman -Syu {package}'"
echo "That's all it took to explain the issue properly Scimmia..." echo "That's all it took to explain the issue properly Scimmia..."
@ -68,18 +68,18 @@ echo "Git is installed!"
echo "Cloning AllPac Repository from Git..." echo "Cloning AllPac Repository from Git..."
sleep 1 sleep 1
git clone https://git.pixelridgesoftworks.com/PixelRidge-Softworks/AllPac.git git clone https://git.pixelridgesoftworks.com/PixelRidge-Softworks/AllPac.git || { echo "Failed to clone repository. Exiting."; exit 1; }
echo "Descending into cloned repo..." echo "Descending into cloned repo..."
sleep 1 sleep 1
cd AllPac/cmd/ || exit cd AllPac/cmd/ || { echo "Failed to change directory. Exiting."; exit 1; }
echo "Ensuring we have up to date dependencies..." echo "Ensuring we have up to date dependencies..."
go mod tidy go mod tidy || { echo "Failed to tidy dependencies. Exiting."; exit 1; }
sleep 1 sleep 1
echo "Building binary..." echo "Building binary..."
go build -o ~/.allpac/bin/allpac go build -o ~/.allpac/bin/allpac || { echo "Failed to build binary. Exiting."; exit 1; }
sleep 1 sleep 1
echo "Binary built!" echo "Binary built!"
@ -103,11 +103,10 @@ sleep 1
if ! grep -qF 'export PATH=$PATH:$HOME/.allpac/bin' "$shell_rc"; then if ! grep -qF 'export PATH=$PATH:$HOME/.allpac/bin' "$shell_rc"; then
echo 'export PATH=$PATH:$HOME/.allpac/bin' >> "$shell_rc" echo 'export PATH=$PATH:$HOME/.allpac/bin' >> "$shell_rc"
fi fi
source "$shell_rc"
updater_url="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Installers/raw/branch/main/allpac/update.sh" updater_url="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Installers/raw/branch/main/allpac/update.sh"
echo "Downloading updater script..." echo "Downloading updater script..."
wget -O ~/.allpac/bin/allpac-updater.sh "$updater_url" wget -O ~/.allpac/bin/allpac-updater.sh "$updater_url" || { echo "Failed to download updater script. Exiting."; exit 1; }
sleep 1 sleep 1
echo "Setting updater script permissions..." echo "Setting updater script permissions..."
@ -116,10 +115,9 @@ sleep 1
echo "Aliasing the updater script..." echo "Aliasing the updater script..."
echo "alias allpac-update-system='~/.allpac/bin/allpac-updater.sh'" >> "$shell_rc" echo "alias allpac-update-system='~/.allpac/bin/allpac-updater.sh'" >> "$shell_rc"
source "$shell_rc"
echo "Cleaning up..." echo "Cleaning up..."
cd ../../ cd ../../ || exit
rm -rf AllPac rm -rf AllPac
echo "AllPac setup complete." echo "AllPac setup complete. Please restart your shell or source your shell configuration file to apply changes."