Files
sols.dev/install.sh
2026-01-19 20:04:36 +11:00

93 lines
2.4 KiB
Bash

#!/usr/bin/env bash
if [ -p "/usr/local/bin" ]; then
echo "Your path is missing /usr/local/bin, you might want to add it. Type the following"
echo "\$PATH=/usr/local/bin:$PATH"
fi
echo "Note: This script requires sudo access."
# Check for required commands
if ! command -v git 2>&1 >/dev/null
then
echo "Git is not installed on your system. Install it with your package manager (or on macOS use xcode-select)"
exit 0;
fi
if ! command -v c++ 2>&1 >/dev/null
then
echo "A compiler linked to `c++` is not installed on your system. Install it with your package manager (or on macOS use xcode-select)"
exit 0;
fi
if ! command -v make 2>&1 >/dev/null
then
echo "make is not installed on your system. Install it with your package manager (or on macOS use xcode-select)"
exit 0;
fi
# Check if Ground is installed
if ! command -v ground 2>&1 >/dev/null
then
read -p "Ground has not been installed on your system. Ground is the runtime VM for Solstice. Would you like to install it? (y/n) " consent
if [ "$consent" != "y" ]
then
echo "Exiting..."
exit 1
fi
echo "Installing Ground..."
mkdir -p ~/.local/share/solstice-installer
cd ~/.local/share/solstice-installer
git clone https://chookspace.com/ground/cground
cd cground
make both
sudo make install
echo "Success!"
fi
# Check if Solstice is installed
if ! command -v solstice 2>&1 >/dev/null
then
read -p "Solstice has not been installed on your system, would you like to install it? (y/n) " consent
if [ "$consent" != "y" ]
then
echo "Exiting..."
exit 1
fi
echo "Installing Solstice..."
mkdir -p ~/.local/share/solstice-installer
cd ~/.local/share/solstice-installer
git clone https://chookspace.com/max/solstice
cd solstice
make
sudo mkdir -p /usr/local/bin
sudo cp solstice /usr/local/bin/solstice
echo "Success!"
exit 0
fi
echo "Solstice is already installed, updating...";
cd ~/.local/share/solstice-installer/solstice
git pull --dry-run
cd ..
cd cground
git pull --dry-run
read -p "Do these changes look okay? If it says 'already up to date', type 'n' (y/n) " consent
if [ "$consent" != "y" ]
then
echo "Exiting..."
exit 1
fi
echo "Updating Ground..."
git pull
make clean
make both
sudo make install
cd ..
echo "Updating Solstice..."
cd solstice
git pull
make clean
make
sudo cp solstice /usr/local/bin/solstice