forked from solstice/sols.dev
Initial commit
This commit is contained in:
90
install.sh
Normal file
90
install.sh
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/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 gmake 2>&1 >/dev/null
|
||||
then
|
||||
echo "gmake 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
|
||||
sudo make install
|
||||
cd ..
|
||||
echo "Updating Solstice..."
|
||||
cd solstice
|
||||
git pull
|
||||
make
|
||||
sudo cp solstice /usr/local/bin/solstice
|
||||
Reference in New Issue
Block a user