Skip to content

Instantly share code, notes, and snippets.

@Ocawesome101
Last active August 7, 2019 19:41
Show Gist options
  • Save Ocawesome101/f32185489b74546705028e11efac1766 to your computer and use it in GitHub Desktop.
Save Ocawesome101/f32185489b74546705028e11efac1766 to your computer and use it in GitHub Desktop.
Script to download and set up MrCrayfish's Battlefields Minecraft launcher on Debian and derivatives.
#!/bin/bash
# This script will download and install the Battlefields launcher and its
# dependencies on your Debian (or derivative) system.
# pass '--arch' to use pacman instead of apt
set -e
echo "Installing dependencies NPM and git..."
if [ "$1" = "--arch" ]; then
sudo pacman -S npm git
else
sudo apt -qqq install npm git
fi
echo "Done."
echo "Cloning the GitHub repository..."
git clone https://github.com/BattlefieldsMC/ElectronLauncher
echo "Done."
cd "$PWD"/ElectronLauncher
echo "Installing the launcher (Grabbing Node and Electron modules)..."
npm -qqq install
echo "Done."
SCRIPT="$HOME/Desktop/battlefields.sh"
echo "Creating run script..."
touch "$SCRIPT"
echo "#!/bin/bash" >> "$SCRIPT"
echo "cd $PWD" >> "$SCRIPT"
echo "npm start" >> "$SCRIPT"
chmod +x "$SCRIPT"
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment