Make updater script more verbose
This commit is contained in:
parent
c5d57aceb9
commit
94210598db
|
@ -5,6 +5,7 @@ mkdir -p ~/.allpac/cache ~/.allpac/logs ~/.allpac/bin
|
||||||
go_version=$(go version 2>/dev/null)
|
go_version=$(go version 2>/dev/null)
|
||||||
required_version="go1.21.5"
|
required_version="go1.21.5"
|
||||||
|
|
||||||
|
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."
|
||||||
|
|
||||||
|
@ -18,6 +19,11 @@ if [[ "$go_version" != *"$required_version"* ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo "Compatible Go version is installed!"
|
||||||
|
echo "Checking if Git is installed..."
|
||||||
|
|
||||||
if ! command -v git &>/dev/null; then
|
if ! command -v git &>/dev/null; then
|
||||||
echo "Git is not installed."
|
echo "Git is not installed."
|
||||||
|
|
||||||
|
@ -31,13 +37,28 @@ if ! command -v git &>/dev/null; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo "Git is installed!"
|
||||||
|
|
||||||
|
echo "Cloning AllPac Repository from Git..."
|
||||||
|
sleep 1
|
||||||
|
|
||||||
git clone https://git.pixelridgesoftworks.com/PixelRidge-Softworks/AllPac.git
|
git clone https://git.pixelridgesoftworks.com/PixelRidge-Softworks/AllPac.git
|
||||||
|
|
||||||
|
echo "Descending into cloned repo..."
|
||||||
|
sleep 1
|
||||||
cd AllPac/cmd/ || exit
|
cd AllPac/cmd/ || exit
|
||||||
|
|
||||||
|
echo "Ensuring we have up to date dependencies..."
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo "Building binary..."
|
||||||
go build -o ~/.allpac/bin/allpac
|
go build -o ~/.allpac/bin/allpac
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo "Binary built!"
|
||||||
|
|
||||||
shell_rc=""
|
shell_rc=""
|
||||||
case $SHELL in
|
case $SHELL in
|
||||||
|
@ -53,17 +74,25 @@ case $SHELL in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo "Adding AllPac to the system path..."
|
||||||
|
sleep 1
|
||||||
echo 'export PATH=$PATH:$HOME/.allpac/bin' >> "$shell_rc"
|
echo 'export PATH=$PATH:$HOME/.allpac/bin' >> "$shell_rc"
|
||||||
source "$shell_rc"
|
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..."
|
||||||
wget -O ~/.allpac/bin/allpac-updater.sh "$updater_url"
|
wget -O ~/.allpac/bin/allpac-updater.sh "$updater_url"
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo "Setting updater script permissions..."
|
||||||
chmod u+rwx ~/.allpac/bin/allpac-updater.sh
|
chmod u+rwx ~/.allpac/bin/allpac-updater.sh
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
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"
|
source "$shell_rc"
|
||||||
|
|
||||||
|
echo "Cleaning up..."
|
||||||
cd ../../
|
cd ../../
|
||||||
rm -rf AllPac
|
rm -rf AllPac
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user